I'm tring to set the log names to this pattern:
ApplicationName.Date.log
This my config file code:
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="Client.%date{dd-MM-yyyy}.log" type="log4net.Util.PatternString"/>
<appendToFile value="true"/>
<rollingStyle value="composite"/>
<datePattern value="dd-MM-yyyy"/>
<maxSizeRollBackups value="-1"/>
<maximumFileSize value="50MB"/>
<PreserveLogFileNameExtension value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %-2level %logger - %message%newline"/>
</layout>
</appender>
The problem is that at midnight, the file becomes corrupted like this:
Client.13-06-2013.log
Client.13-06-2013.1.log
Client.13-06-201313-06-2013.1.log
Client.13-06-201313-06-2013.2.log
Client.13-06-201313-06-2013.log
What I wanted is:
Client.13-06-2013.log
Client.13-06-2013.1.log
Client.13-06-2013.2.log
Client.14-06-2013.1.log
Client.14-06-2013.log
Any advice will be welcome.