#29 RollingFileAppender bug when using Date RollingStyle

v1.2.0
open
General (51)
5
2014-12-20
2003-03-12
Naiden
No

this is my config for the rolling file appender:

<appender name="WPAppender"
type="log4net.Appender.RollingFileAppender">
<param name="File"
value="Log\\WPLog-" />
<param name="AppendToFile"
value="true" />
<param name="DatePattern"
value="yyyy-MM-dd.\\l\\o\\g" />
<param name="RollingStyle"
value="Date" />
<param
name="StaticLogFileName" value="false" />
<param name="Threshold"
value="DEBUG" />

<layout
type="log4net.Layout.PatternLayout,log4net">
<param
name="ConversionPattern" value="%d{HH:mm:ss} [%t]
%-5p %c{1} %M() [%x] - %m%n" />
</layout>
</appender>

The problem with this is the fact that my log files get
overriten everyday at noon. I have been able to duplicate
this behavior on a consistent basis. From what I've been
able to gather, it seems that the ComputeCheckPeriod
returns a RollPoint.HALF_DAY (2), as opposed to
RollPoint.TOP_OF_DAY (3) which I expected. I figured
this out by turning on the debug, and looking at the
debug output for the RollingFileAppender.
I would really appreciate if someone could give me a
clue as to what i'm doing wrong.

Discussion

  • Nicko Cadell

    Nicko Cadell - 2004-04-18

    Logged In: YES
    user_id=278872

    This is fixed in CVS. The updated version of the appender can
    be found here:
    http://cvs.apache.org/viewcvs.cgi/logging-
    log4net/src/Appender/RollingFileAppender.cs?
    rev=1.5&view=auto

     
  • Chris Arrowood

    Chris Arrowood - 2005-02-17

    Logged In: YES
    user_id=294623

    Yes - This has been killing me. The following configuration
    will work though. The current log will simply be called log
    (with no extension.)

    <appender name="RollingLogFileAppender"
    type="log4net.Appender.RollingFileAppender">
    <param name="File" value="C:\\Logs\\MyApp\\log" />
    <appendToFile value="true" />
    <rollingStyle value="Date" />
    <datePattern value="'-'yyyyMMdd'.log'"/>
    <layout type="log4net.Layout.PatternLayout">
    <param name="ConversionPattern" value="[%d][%-5p][%C{1}]
    %m%n" />
    </layout>
    </appender>

    I would LOVE to see someone rework the way way this appender
    handles roll-by-date. Maybe it needs to be its own appender?

     
  • Chris Arrowood

    Chris Arrowood - 2005-02-17

    Logged In: YES
    user_id=294623

    hhmmm; Maybe I'll get the CVS version; I just saw
    ncadell's comment. Will there be any more releases for this
    project? Is it dead? It's been a while...

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks