logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Hashimshony <ronh...@gmail.com>
Subject Re: TimeBasedRollingPolicy problem
Date Thu, 30 Nov 2006 14:11:19 GMT

Hi,

Maybe the problem is that i don't use the XML config, but the ini config?

Thanks.


Jostein Tveit wrote:
> 
> Ron Hashimshony <ronhash@gmail.com> writes:
> 
>> I am trying to use this appender, which looks very powerful.
>> My problem is that the file name is always .1, no matter what i write in
>> the
>> FileNamePattern.
> 
> This config works for me.
> Log4cxx logs to ./logs/logger1.log all day, and at midnight it
> renames the file to ./logs/logger1.log.YYYY-MM-DD
> 
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE log4j:configuration>
> 
> <log4j:configuration xmlns:log4j='http://logging.apache.org/'
> debug="false">
> 
>   <appender name="Log1"
> class="org.apache.log4j.rolling.RollingFileAppender">
>     <rollingPolicy
> class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
>       <param name="fileNamePattern"
> value="./logs/logger1.log.%d{yyyy-MM-dd}"/>
>     </rollingPolicy>
>     <layout class="org.apache.log4j.PatternLayout">
>       <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss,SSS}
> %x [%p] (%F:%L) %m%n"/>
>     </layout>
>     <param name="file" value="./logs/logger1.log"/>
>     <param name="append" value="true"/>
>   </appender>
> 
>   <logger name="logger1">
>     <appender-ref ref="Log1"/>
>     <level value="INFO"/>
>   </logger>
> 
> </log4j:configuration>
> 
> -- 
> Jostein Tveit <josteitv@pvv.ntnu.no>
> 
> 

-- 
View this message in context: http://www.nabble.com/TimeBasedRollingPolicy-problem-tf2727061.html#a7620000
Sent from the Log4cxx - Users mailing list archive at Nabble.com.


Mime
View raw message