How can I setup log4net so that it rolls based on date or time.

  • Thread starter Thread starter Andrzej
  • Start date Start date
A

Andrzej

Currently I'm doing this:

<param name="File" value="c:\\temp\\Applog.txt"/>
<param name="AppendToFile" value="true"/>
<param name="RollingStyle" value="Date"/>
<param name="StaticLogFileName" value="true"/>

does not work.
 
Andrzej, what's the error that you get? Any? What kind of application are
you trying to do this from? Does that app/user have access to the temp
directory? Also, if you aren't seeing an error could you turn log4net
internal logging on with this:

<appSettings>
<!-- To enable internal log4net logging specify the following appSettings
key -->
<!--<add key="log4net.Internal.Debug" value="true"/>-->
</appSettings>
 
Hi,

I get no error, but I could not roll the file based on date, but I
figured this out already.

Thanks.

This is what I do:
<param name="AppendToFile" value="true"/>
<param name="DatePattern" value=".yyyy-MM-dd&quot;.txt&quot;" />
<param name="RollingStyle" value="Date"/>
<param name="StaticLogFileName" value="true"/>
 
Back
Top