[
https://issues.apache.org/jira/browse/LOG4NET-501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16323238#comment-16323238
]
Dominik Psenner commented on LOG4NET-501:
-----------------------------------------
I'm not a fan of destructors and their usage is almost always a hack. I agree
that the disposal of unmanaged resources in appenders needs improvement. The
logging framework should attempt to properly clean up on shutdown, but this
ultimately requires the application that uses log4net to shutdown/dispose the
framework. What this implication means for all the different application
flavours and framework targets like the new asp dotnet core mvc needs proper
investigation and ultimately the collaboration in the community.
> 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.4.14#64029)