logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cyz <zhoup...@micron.com>
Subject Re: RollingFileAppender
Date Fri, 14 Jan 2011 06:01:06 GMT

Tried the configuration, but the backup file name is still log.txt.1,
log.txt.2, doesn't append with datetime as specified in DatePattern


Jim Scott-8 wrote:
> 
> Try this
> 
> <appender name="RollingFileAppender" 
> type="log4net.Appender.RollingFileAppender">
> <file value="log.txt" />
> <appendToFile value="true" />
> <rollingStyle value="Size" />
> <maxSizeRollBackups value="-1" />
> <maximumFileSize value="10MB" />
> <staticLogFileName value="true" />
> <countDirection value="0" />
> 
> <layout type="log4net.Layout.PatternLayout">
> <conversionPattern value="%date [%thread] %-5level %logger 
> [%property{NDC}] - %message%newline" />
> </layout>
> </appender>
> 
> On 1/13/2011 8:28 PM, cyz wrote:
>> Hi, I'd like to have a logging system with below behaviors, is
>> RollingFileAppender able to achieve?
>> 1>  messages are logged to a fixed file name, say log.txt.
>> 2>  log files are auto backup by sizes. I.e. when log.txt hits the
>> configured
>> size, it's renamed as logyyMMddHHmmss.txt, next message coming in will be
>> written to log.txt again.
>> 3>  there is no limit on how many files can be backup.
>>
>> Thank you.
> 
> 

-- 
View this message in context: http://old.nabble.com/RollingFileAppender-tp30668883p30669112.html
Sent from the Log4net - Users mailing list archive at Nabble.com.


Mime
View raw message