logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Radovan Raszka" <ras...@hasam.cz>
Subject RE: Date Rollover filename
Date Wed, 22 Sep 2010 06:10:28 GMT
Yes, I didn't tested suggested configuration, but some chars used as standard formatting strings
must be escaped in order to preserve them.

________________________________

Od: David Gerler [mailto:dgerler@gmail.com] 
Odesláno: 21. září 2010 16:08
Komu: 'Log4NET User'
Předmět: RE: Date Rollover filename



It should be noted as well that I had to escape the t's in txt.

 

yyyy-MM-dd.\tx\t

 

From: Radovan Raszka [mailto:raszka@hasam.cz] 
Sent: Tuesday, September 21, 2010 1:16 AM
To: Log4NET User
Subject: RE: Date Rollover filename

 

Please notice, that <file value="..\\Data\\Logs\\debug" /> _doesn't_ contain extension.

 

Your config should be like this:

    <appender name="Root" type="log4net.Appender.RollingFileAppender">

                <file value="c:/log/synch/root" />

                <appendToFile value="true" />

                <maxSizeRollBackups value="10" />

                <datePattern value="yyyy-MM-dd.txt" />

                <rollingStyle value="Date" />

                <staticLogFileName value="false" />

                <layout type="log4net.Layout.PatternLayout">

                                <header value="[Header]&#xD;&#xA;"/>

                                <footer value="[Footer]&#xD;&#xA;"/>

                                <conversionPattern value="%date [%thread] %-5level %logger
(%file:%line) - %message%newline" />

                </layout>

    </appender>

 

Now log files will have names in form root2010-09-21.txt (for today's date)

Radovan

 


Mime
View raw message