Monday, May 21, 2012
 
The best way to analyze your logs! Minimize
 Log4Net Mail archive   

The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.

Subject: RollingFileAppender behavior on program exit
Prev Next
You are not authorized to post a reply.

Author Messages
daniel.nitecki@o-i.com

02/04/2009 3:40 PM  


Hi,
I am using log4net 1.2.10 RollingFileAppender in C#/VS2005.  Rolling the files by date.  Everything is
working fine except that the final log file written before program exit is not rolled and remains named
as a temp file (just the name as specified in file value without the date pattern and extension).  I am
calling the Shutdown function, but this does not seem to help.  Attached is the .config xml I'm currently
using.  Its set to rollover on minute boundaries as a debugging convenience.  Some of the tags may be
extraneous, I've been trying a few different strategies for dealing with this...
As an additional layer of complexity, I'm actually using this from VB6/COM.  My C# code is just a
ComVisible wrapper to the basic log4net calls.
Any input would be appreciated.  This is starting to drive me nuts.

Regards,

Dan

daniel.nitecki@o-i.com

02/04/2009 3:44 PM  

arg...
Here is the xml I promised:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>
  <!-- Register a section handler for the log4net section -->
  <configSections>
    <section name="log4net" type="System.Configuration.IgnoreSectionHandler" />
  </configSections>

  <appSettings>
    <!-- To enable internal log4net logging specify the following appSettings key -->
    <!-- <add key="log4net.Internal.Debug" value="true"/> -->
  </appSettings>

  <!-- This section contains the log4net configuration settings -->
  <log4net>
    <appender name="MinuteRollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
      <file value="C:\OIApps\Interactive\MSDiagnostics\MSDLog" />
      <appendToFile value="true" />
      <rollingStyle value="Date" />
      <datePattern value="HHmm.lo\g" />
      <lockingModel       type="log4net.Appender.FileAppender+MinimalLock" />
      <bufferSize value="0" />
      <ImmediateFlush value="true" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"
/>
      </layout>
    </appender>

    <root>
      <level value="ALL" />
      <appender-ref ref="MinuteRollingLogFileAppender" />
    </root>

  </log4net>
</configuration>

You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > RollingFileAppender behavior on program exit



ActiveForums 3.7

 

 

 

 

 

 

 

 

Log4Net Dashboard

Log analysis and monitoring made easy!

Log4Net Dashboard is a log viewer that can read log statements from a variety of logging output targets.

You can download a free developer version.

  

Check it out!

On the demonstration site you can try it  with live data.demo.l4ndash.com - Try Log4Net Dashboard with live data

The mail archive is a copy of all the mail sent to the mail address: log4net-user@logging.apache.org, organized as a forum.

If you would like to participate in the mail list, send a mail to log4net-user-subscribe@logging.apache.org.

More information about the mailing list is available on: http://logging.apache.org/log4net/support.html

 

A complete topic list is available and can be viewed here (warning, it takes some time to load)

 

Copyright 2005-2008 by FaktNet AS Terms Of Use Privacy Statement