You should remove <StaticLogFileName value="true" /> . I think the documentation might be a little confusing, but in my experience, under this setting the RollingFileAppender will only write to that one file, and not make any backups.

On 11/15/05, Moss, Barney <[EMAIL PROTECTED]> wrote:
I use the RollingFileAppender to write a logfile from a long-lived process.
It is configured with static logfile name and to roll by date:

                <appender name="LogfileAppender" type="log4net.Appender.RollingFileAppender">
                        <file  value="logs\\CAPS_DMS.log" />
                        <RollingStyle value="date" />
                        <StaticLogFileName value="true" />
                        <MaxSizeRollBackups value="10" />
                        <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
                        <layout type="log4net.Layout.PatternLayout">
                                <param name="ConversionPattern" value="%d [%t] %-5p %c{1} - %m%n" />
                        </layout>
                        <filter type="log4net.Filter.LevelRangeFilter">
                                <param name="LevelMin" value="DEBUG" />
                        </filter>
                        <filter type="log4net.Filter.DenyAllFilter" />
                </appender>

The problem is that if the process happens to run over midnight (e.g. starts at 11pm, runs for 2 hours), the first message after midnight causes the logfile to be truncated without being renamed first.  The first message in the file is from just past midnight.

Is this a known bug?  I didn't find anything in the mail list archives.
-thanks, Barney Moss

==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:

http://www.csfb.com/legal_terms/disclaimer_external_email.shtml

==============================================================================


Reply via email to