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

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.
 
G

Greg Ewing [MVP]

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>
 
A

andy wegrzyn

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"/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top