I'd like to configure log4net to append the name to the filenames when rolling by size. I've only played around with the configuration section of log4net, not sure if I have to configure something in code for this.
This is what I have now:
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="C:\\rolling-log.txt" />
<appendToFile value="true" />
<datePattern value="_yyyy-MM-dd" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10KB" />
<rollingStyle value="Size" />
<staticLogFileName value="true" />
<preserveLogFileNameExtension value="true"/>
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%m%n" />
</layout>
</appender>
I can only get the date in the filename if the rollingStyle
is set to Date
, but then it doesn't roll on size anymore.
What am I missing here?
log2013-31-5_1.log
,log2013-31-5_2.log
,log2013-1-6_1.log
, etc. I'm not asking too much, am I? :) – Adrian