Hi.

There seems to be a problem with logging when an application registers
an event handler for the domain unload event or process exit event. Both
log4net and the application will be processing these events at the same
time and in my application this means that log4net will shut down faster
than my application will. Since my application uses logging all the way
until it ends this behavior causes my application to crash since the
logging framework has already shutdown. This is probably most evident in
ASP.NET applications if the Application_End handler is used.

Suggested resolution:
There is a private method LoggerManager.RegisterAppDomainEvents in
log4net. If that method would be changed to public and a corresponding
public UnRegisterAppDomainEvents would be added the problem would be
solved. The developer could then choose to unregister the event handlers
and handle log4net shutdown manually. It would be a simple fix.

Does anyone else have these problems or perhaps even a better solution
to the problem? Suggestions? Opinions?

Best regards,

Daniel Haglund

Reply via email to