Custom Trace Listener - Object Lifetime Problem

Topics: Logging Application Block
May 24, 2007 at 7:11 PM

I have written a custom trace listener for the Logging Application block of Enterprise Library 3.0.

This trace listener creates a thread so my logging activities can be done asynchronously.

All is working very well except that I need to know when the thread in question should be stopped so the application using me will terminate correctly. This is where I am having problems.

In short, overriding the “Dispose(bool disposing)” of the CustomTraceListener object does not work as it is never called.:-(

Anyone know of another technique I could use to determine when the logging application block is being disposed/is terminating so I can cleanup correctly?

Any help would be greatly appreciated.