logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Sirmovics <t...@axima.com.au>
Subject RE: RollingFileAppender overwriting file
Date Wed, 28 May 2014 22:44:54 GMT
I have changed the locking model to InterProcessLock but the problem still occurs.
I started logging the thread number and found it is consistently "1" throughout all runs of
the application.

At this stage with no other ideas I am going to make sure the application does not execute
from 11:30 - 12:30 and see if this helps it to roll the log over correctly.

From: Dominik Psenner [mailto:dpsenner@gmail.com]
Sent: Tuesday, 27 May 2014 04:24 PM
To: 'Log4NET User'
Subject: AW: RollingFileAppender overwriting file

Just to be sure, use an InterProcessLock in your configuration and check if this happens again.
You might also want to include process information in the log messages.

Von: Tim Sirmovics [mailto:tims@axima.com.au]
Gesendet: Dienstag, 27. Mai 2014 02:49
An: log4net-user@logging.apache.org<mailto:log4net-user@logging.apache.org>
Betreff: FW: RollingFileAppender overwriting file

I have been using the RollingFileAppender through numerous log4net version for about 3-4 years.
In the last few days I am now experiencing the following issue:


1.       Assume today is 27/05/2014

2.       Current log file is called Debug.log

3.       Log file builds up throughout the day.

4.       Next day (28/05/2014), log file Debug.log.27.log exists, last write time according
to windows is 27/05/2014 11:59 pm

5.       Open log file, all entries from 27/05 are gone, log only contains a very small number
of entries dated 28/05/2014 just after midnight.

I am now losing my logs for each day as they are being overwritten by the first few logs after
midnight.
Only one process writes to this file.
The process is limited to only running a single instance at a time.
I have not changed my configuration for a long time, however I have included it below.


<!-- Last month, one file per day -->
  <appender name="DebugRollingFileAppender" type="log4net.Appender.RollingFileAppender">
    <file value="Logs\Debug.log" />
    <appendToFile value="true" />
    <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
    <rollingStyle value="Date" />
    <datePattern value=".dd'.log'" />
    <maxSizeRollBackups value="14" />
    <threshold value="DEBUG"/>
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="|%date| |%-5level| |%property{log4net:HostName}| |%logger{2}|:
%message%newline" />
    </layout>
  </appender>


Is there any way I can prevent this from happening?

Tim Sirmovics
IT
tims@axima.com.au<mailto:tims@axima.com.au>

[www.axima.com.au]
AXIMA Pty. Ltd.
135 Boundary Road, Laverton North
Victoria 3026 Australia
T: +61 3 83685300
F: +61 3 83685333
W: www.axima.com.au<http://www.axima.com.au>

This message and any files transmitted with it are confidential and are intended solely for
the use of those persons to whom the message is addressed. If you have received this message
in error, please destroy and delete this message from your computer. Any unauthorised reproduction
of this message or any files transmitted with it is strictly prohibited. All business is conducted
pursuant to Axima's trading terms and conditions which may exclude or limit liability in certain
circumstances.


-------------------------------Safe Stamp-----------------------------------
Your Anti-virus Service scanned this email. It is safe from known viruses.
For more information regarding this service, please contact your service provider.

Mime
View raw message