I believe the root-cause of the problem was the missing
definitions for the "AppendToFile" and "RollingStyle" parameters in
the configuration file.
After
I changed the config file as follows, the problem just
vanished:
<!-- XA is set to
be a FileAppender for XML -->
<appender name="XA" type="log4net.Appender.RollingFileAppender">
<File value="C:\\Applogs\\FixMarketDataData.xml" />
<appender name="XA" type="log4net.Appender.RollingFileAppender">
<File value="C:\\Applogs\\FixMarketDataData.xml" />
<param name="AppendToFile"
value="true" />
<param name="RollingStyle" value="Date" />
<param name="RollingStyle" value="Date" />
<!-- Daily Rollover
-->
<DatePattern value="yyyy-MM-dd" />
<DatePattern value="yyyy-MM-dd" />
<!-- XA uses XMLLayout
-->
<layout type="log4net.Layout.XMLLayout">
<!-- <LocationInfo value='true' /> -->
</layout>
</appender>
<layout type="log4net.Layout.XMLLayout">
<!-- <LocationInfo value='true' /> -->
</layout>
</appender>
Thanks.
-Senthil SS.
From: Senthil Sivasubramanian S
Sent: Wednesday, November 03, 2004 3:11 PM
To: [email protected]
Subject: RollingFileAppender problem
I am logging XML
data using RollingFileAppender at daily intervals:
<!-- XA is set to be a FileAppender for XML -->
<appender name="XA" type="log4net.Appender.RollingFileAppender">
<File value="C:\\Applogs\\FixMarketDataData.xml" />
<appender name="XA" type="log4net.Appender.RollingFileAppender">
<File value="C:\\Applogs\\FixMarketDataData.xml" />
<!-- Daily Rollover
-->
<DatePattern value="yyyy-MM-dd" />
<DatePattern value="yyyy-MM-dd" />
<!-- XA uses XMLLayout
-->
<layout type="log4net.Layout.XMLLayout">
<!-- <LocationInfo value='true' /> -->
</layout>
</appender>
<layout type="log4net.Layout.XMLLayout">
<!-- <LocationInfo value='true' /> -->
</layout>
</appender>
Due to very high
rate of data transfer in the application, the file size can grow upto 40, 50 Mb
during the day. Usually everything is working fine with this daily rollover
logging. But rarely (like once or twice in a week) I notice that the
logfile gets itself truncated and the logging has resumed sometime
during the middle of the day. (I have ensured that there was no Application
restart when this logfile truncation has apparently happened.) This random
behaviour leads to a huge loss of debug information.
I am using log4net
1.2.0 Beta 6.
Is this a known
problem with this version of log4net?
Can you suggest how
can I go about solving this issue.
Thanks.
Senthil
SS.
Techspan (India)
Ltd.
