logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Pennenga <rpenne...@angel-med.com>
Subject RE: Log files overwritten
Date Fri, 01 Jun 2012 16:37:39 GMT
I'm interested in the answer.  I use <rollingStyle value="Size"><maxSizeRollBackups
value="2">; I lack the imbedded date, but it does the right thing on restart.  I recall
starting with a setup like that below (<rollingStyle value="Composite">), and recall
seeing this same behavior, and finally being told that it was a limitation of the implementation.


From: Pascal ROZE [mailto:pascal.roze@gmail.com]
Sent: Friday, June 01, 2012 12:19 PM
To: Log4NET User
Subject: Log files overwritten

Hello everyone

I have a rolling file appender hosted in an IIS 6.0 application that looks like:

<appender name="RollingFileError" type="log4net.Appender.RollingFileAppender">
    <file value="C:\Logfiles\"/>
    <datePattern value="Error\s.yyyyMMdd.lo\g"/>
    <threshold value="ALL"/>
    <appendToFile value="true"/>
    <rollingStyle value="Composite"/>
    <maximumFileSize value="1MB"/>
    <maxSizeRollBackups value="-1" />
    <countDirection value="1" />
    <staticLogFileName value="false"/>
    <preserveLogFileNameExtension value="true"/>
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="*%-10level %-30date %-25logger %-15property{log4net:HostName}
ThreadID: %-10thread %message %newline"/>

So, at the end of the day, I have some files like Errors.20120601.0.log, Errors.20120601.1.log,
Errors.20120601.2.log and so on.

But, if the application is restarted during the day, log file names restart from 0 and the
existing files are overwritten one after the other.

How to avoid that?

Thanx for your help


View raw message