Hi Baron:
I am using the RollingFileAppender as well, and don't have any issues. The only
thing I could see
with your configuration that is different than mine is the datePattern
parameter that you are
using. Here is my configuration for the RollingFileAppender, which seems to
roll over at midnight
and does not truncate. I also use a filter, but that should not make a
difference.
<appender name="DEBUGRollingLogFileAppender"
type="log4net.Appender.RollingFileAppender">
<file
value="C:\\Scratch\\SOW\\WfStatusTrackingClient\\DEBUG.log" />
<appendToFile value="true" />
<datePattern value="yyyyMMdd" />
<rollingStyle value="Date" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%d{yyyy-MM-dd
HH:mm:ss,fff} %-5p - [%t] %c: %m%n" />
</layout>
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="DEBUG" />
</filter>
<filter type="log4net.Filter.DenyAllFilter"/>
</appender>
Marc
--- Baron Schwartz <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've searched Google and the Eyebrowse for this and can't find anything
> relevant (EyeBrowse seems to have a lot of issues -- about half the links
> I click on just lead to a stacktrace). I'm not sure if this is an issue
> with log4net or my configuration. Any pointers are much appreciated.
>
> Problem: my log files are rolled daily, but every day at noon the existing
> data is blanked out of the log (the file is truncated). The effect is
> that when I look at yesterday's file, I only see information for yesterday
> after noon, not before noon. I have actually watched this happen; the
> first statement that writes to the file after noon truncates everything
> already in the file.
>
> My version: 1.2.0.30714. I'm on Windows, MS.NET Framework v1.1.4322 using
> Visual Studio 2003 and linking to the pre-built DLL from SourceForge.
>
> Sample of my App.config file:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
> <configSections>
> <section name="log4net"
> type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
> </configSections>
> <log4net>
> <appender name="FileAppender"
> type="log4net.Appender.RollingFileAppender">
> <file value="//server/share$/log/log-" />
> <appendToFile value="true" />
> <datePattern value="yyyy-MM-dd.\\tx\\t" />
> <rollingStyle value="Date" />
> <staticLogFileName value="false" />
> <layout type="log4net.Layout.PatternLayout">
> <conversionPattern value="%-5p %-20t %d %c line %L%n
> %m%n" />
> </layout>
> </appender>
> <root>
> <level value="INFO" />
> <appender-ref ref="FileAppender" />
> </root>
> </log4net>
>
>