Hy everyone! I do need your help. I would like to create a logfile for my application one a day (eg. Logfile_20090210.log for today, Logfile_20090211.log for tomorrow etc.). the log4net config file looks like this
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="C:\\PrintService.log" />
<param name="AppendToFile" value="true" />
<param name="rollingStyle" value="Date" />
<param name="datePattern" value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<!-- <param name="Header" value="[Header]\r\n" />
<param name="Footer" value="[Footer]\r\n" /> -->
<param name="ConversionPattern" value="%d [%t] %-5p %c %m%n" />
</layout>
</appender>
<root>
<!-- <level value="INFO" /> -->
<appender-ref ref="RollingLogFileAppender" />
</root>
</log4net>
</configuration>
I do have two problems: there is no logfile with the config above. when I change this to "yyyyMMdd-HHmm" for datePattern, then it works, but I do not want the time to be part of the logfilename. the second problem is the logfile is named PrintServce.log20090210-1346 for example. So my question: What does the config have to look like to get PrintServer_20090210.log for example? I found pages with configs similar like mine ("yyyyMMdd" for datePattern). But none worked! Thanks for any help! Stephan.