logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "NN (JIRA)" <j...@apache.org>
Subject [jira] [Created] (LOG4NET-484) System.ObjectDisposedException with FileAppender+InterProcessLock
Date Tue, 27 Oct 2015 08:35:27 GMT
NN created LOG4NET-484:

             Summary: System.ObjectDisposedException with FileAppender+InterProcessLock
                 Key: LOG4NET-484
                 URL: https://issues.apache.org/jira/browse/LOG4NET-484
             Project: Log4net
          Issue Type: Bug
          Components: Appenders
    Affects Versions: 1.2.13, 1.2.14, 1.2.15, 1.3.0
            Reporter: NN
            Priority: Blocker

Configure lockingModel for InterProcessLock with RollingFileAppender.

<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
  <lockingModel type="log4net.Appender.FileAppender+InterProcessLock" />

Write a lot of logs for instance:

const int N = 1000 * 200;
for (var i = 0;i < N; i++) m_log.Info("A");

When finilizers are called at the end of the program there is an exception:

log4net:ERROR Failed to Close appender [RollingFileAppender]
System.ObjectDisposedException: Safe handle has been closed
   at System.Threading.WaitHandle.WaitOneNative(SafeWaitHandle waitHandle, UInt3
2 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)
   at System.Threading.WaitHandle.WaitOne(Int64 timeout, Boolean exitContext)
   at log4net.Appender.FileAppender.InterProcessLock.AcquireLock()
   at log4net.Appender.FileAppender.LockingStream.AcquireLock()
   at log4net.Appender.FileAppender.WriteFooter()
   at log4net.Appender.TextWriterAppender.WriteFooterAndCloseWriter()
   at log4net.Appender.TextWriterAppender.Reset()
   at log4net.Appender.FileAppender.Reset()
   at log4net.Appender.TextWriterAppender.OnClose()
   at log4net.Appender.AppenderSkeleton.Close()
   at log4net.Util.AppenderAttachedImpl.RemoveAllAppenders()

This message was sent by Atlassian JIRA

View raw message