#67 Log4net stops logging.

v1.2.0
open
nobody
None
5
2004-08-20
2004-08-20
Anonymous
No

We configure log4net-1.2.0-beta8 with:

<log4net>
<appender name="ConsoleAppender"
type="log4net.Appender.ConsoleAppender">
<layout
type="log4net.Layout.PatternLayout">
<conversionPattern
value="%-4r [%t] %-5p %c %x - %m%n" />
</layout>
</appender>
<appender name="RollingFileAppender"
type="log4net.Appender.RollingFileAppender">
<param name="File"
value="Log/TCMServiceLog.txt" />
<param name="AppendToFile"
value="true" />
<param name="RollingStyle"
value="Size" />
<param name="MaximumFileSize"
value="500KB" />;
<param
name="MaxSizeRollBackups" value="500" />
<param name="StaticLogFileName"
value="true" />
<layout
type="log4net.Layout.PatternLayout">
<param
name="ConversionPattern" value="%d;%-5p;%c;%t;%m%n" />
</layout>
</appender>
<root>
<level value="INFO" />
<appender-ref
ref="ConsoleAppender" />
<appender-ref
ref="RollingFileAppender" />
</root>
<logger name="mon.messaging" >
<level value="ERROR" />
</logger>
<logger name="io.messaging.Hogia" >
<level value="ERROR" />
</logger>
<logger
name="Hogia.Pts.Pakke2.TCM.TCMTcpConnectionToTCA" >
<level value="ERROR" />
</logger>
</log4net>

We run a server application (as a service) on a
dual-processor machine that fills each log file every
two minutes (ie lots of rotations for the
rollingfileappender). After a couple of days the
logging stops. The service continues to function
properly, but there is no more logs. This only happens
at the production server so I have not been able to see
what might be wrong.
After removing the ConsoleAppender's configuration
(which shouldn't have been there from the beginning)
the logging started again. I don't know if that is
because log4net reconfigured iself when the config file
was changed or if the ConsoleAppender had anything to
do with it.

Discussion

  • Logged In: NO

    With the ConsoleAppender removed, it stopped logging after a
    few days again. :-(

     
  • Logged In: NO

    Forgot to add three things. The logging stops at random
    points in the logfile, not while rotating. We also log to
    the same logger from multiple threads and we use the 1.1
    framework.