Matthias Hess created LOG4NET-501:
-------------------------------------
Summary: Finalization of appenders might fail
Key: LOG4NET-501
URL: https://issues.apache.org/jira/browse/LOG4NET-501
Project: Log4net
Issue Type: Bug
Components: Core
Affects Versions: 1.2.10
Reporter: Matthias Hess
Given the following example:
{code}
LogLog.InternalDebugging = true;
RollingFileAppender result = new RollingFileAppender();
result.File = ...;
result.AppendToFile = true;
result.Encoding = Encoding.UTF8;
...
result.ActivateOptions();
{code}
When this rolling file appender object gets finalized (due to no more
references), the finalization code tries to close the underlying file stream.
This will fail, if the underlying file stream itself was already subject to
finalization.
It gives me log4net internal error messages when using the appenders outside of
a logger repository.
I think, the current finalization code does a little too much. Writing a
footer/flushing should be triggered by the AppDomain events only.
What do you think about it?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)