I have a problem with log4net in this scenario
- Today is 30/11/2014
- Current log file is called log.txt
- Log file builds up throughout the day.
- Next day (01/12/2014) , log file exist at log.txt20141130
- But when I Open log file, all entries from 30/11 are lose, log only contains a very small number of entries dated 01/12/2014 just after midnight.
Now I'm now losing my logs for each day as they are being overwritten by the first few logs after midnight.
Is there any way I can prevent this from happening?
Thankyou
This is my Config log4net file
<appender name="Test" type="log4net.Appender.RollingFileAppender">
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<file value= "C:\Test\Log\log.txt" />
<appendToFile value="true" />
<rollingStyle value="Composite" />
<datePattern value="yyyyMMdd" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="1MB" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date|%level|%thread|%property{function}|%property{flowid}|%message%newline" />
</layout>
</appender>
Have you tried removing
<rollingStyle value="Composite" />
Above is my log4net configuration and it rolls the files as expected, previous days logs all available.