logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: Can I have time stamp in log file name?
Date Mon, 21 Feb 2005 17:37:13 GMT
Soon.  You can get this capability using log4j's RollingFileAppender 
with a TimeBasedRollingPolicy.  You can configure it like:

   <appender name="ROLL" 
class="org.apache.log4j.rolling.RollingFileAppender">
     <rollingPolicy 
class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
       <param name="fileNamePattern" 
value="output/test1-%d{yyyy-MM-dd_HH_mm_ss}"/>
     </rollingPolicy>

     <layout class="org.apache.log4j.PatternLayout">
       <param name="ConversionPattern" value="%c{1} - %m%n"/>
     </layout>	
   </appender>

DailyRollingFileAppender is deprecated in log4j has already been 
removed from log4cxx.  RollingFileAppender, supporting classes and 
related tests will be ported to log4cxx before 0.9.8 is released 
(http://issues.apache.org/jira/browse/LOGCXX-52)


Mime
View raw message