Logging with Multiple Trace Listeners: When Bad Things Happen

Topics: Logging Application Block
Dec 20, 2008 at 12:47 AM
It appears that when applications are configured to log using multiple trace listeners AND when the first trace listener is an Event Log trace listener AND the application's process doesn't have permissions to create the corresponding event source THEN a security exception is raised and evidently caught within the Logging Application Block, but the LogEntry is not written out to the the other trace listeners.  In my opinion this is not what most would expect.  What I would expect is for an attempt at writing to each configured listener regardless of the success or failure of previous trace listeners (at least as a default behavior).  I haven't examined the code to see if this is indeed true, but this is the behavior I am experiencing. 
Dec 22, 2008 at 11:18 AM
Hi,

See this thread if this answers your question:

http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=8892

Valiant Dudan
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
Dec 22, 2008 at 2:21 PM
I didn't really have a question about this so much as a request that the EntLib team confirm this behavior before I enter it as an official issue.
Jan 5, 2009 at 7:59 AM
Hi,

I have successfully repro your error, but not with the persmission issue, I turn off my EventLog service and tried logging, I have 2 listeners, The formattedEventLog and the FlatFile, certainly, the event log would fail because the service is turned off. So as the FlatFile also, it doesnt log to a flatfile due to the failure of the event log. You can now add this as a Issue.


Valiant Dudan
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com