Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I've a RollingFileAppender that appears to be loosing files at some point.
For example: I have the following log files in my log folder
applog.log.220
applog.log.221
applog.log.222
applog.log.224
applog.log.225

For some reason, applog.log.223 is missing. When I look at the last log message in 222 log and compare it to first log message in 224 log, I see several minutes are missing. In some cases it would be as little as 5 minutes and as long as 45 minutes.
below is my config:
XML
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
      <param name="File" value="D:\Log Files\applog.log"/>
      <param name="AppendToFile" value="true"/>
      <param name="RollingStyle" value="Size"/>
      <param name="MaxSizeRollBackups" value="1000"/>
      <param name="MaximumFileSize" value="20MB"/>
      <param name="StaticLogFileName" value="true"/>
      <param name="CountDirection" value="1"/>
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="%date  %-5p %25.25c [%x][%5thread] - %message%newline"/>
      </layout>
    </appender>

any help would be appreciated.

thanks
Posted
Updated 24-Aug-12 5:28am
v3
Comments
[no name] 24-Aug-12 11:33am    
You would probably get a better/faster answer if you asked at the Log4Net support forum.

1 solution

Presuming that you are not using AppDomains or multiple processes to write to the same file then it is is a problem in Log4net. And unfortunately last time I checked no one really seemed to be supporting that logger. So you might have to fix it yourself. Or switch to a different logger.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900