Entlib 5 Logging - not all TraceListeners firing

Topics: Logging Application Block
Apr 3, 2012 at 11:21 AM

I have the following configuration:

A Custom Category with two two Custom TraceListeners. The first one fires an exception. This leads to the problem that the second one will not be activated.

This problems only occurs per category, since the CategorySource have a catch-block in their loop. But the TraceListeners are not "shielded".

See in Entlib Source:

File: LogSource.cs

In TraceData() in the foreach-Loop there's no catch-Block so the first exception terminates the loop.

How can this problem be fixed?

Thanks in advance.

Marius Filipowski

Apr 4, 2012 at 8:19 AM
Edited Apr 4, 2012 at 4:08 PM

Yes, you are right about LogSource stopping processing after an exception.  I wrote up a 3 part article on this.  If you just want to get to the code you can download the associated project directly.

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com 

Apr 11, 2012 at 1:32 PM

Very interesting article and your code to solve the problem. Will this fix be included in an Entlib Release in the near future?

Marius Filipowski

Apr 15, 2012 at 1:42 AM

I'm not sure what the official plans are.  You could post a feature request on the EntLib Uservoice site

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com