Turn off LogEnabled Filter at run time - Logging Enterprise Application Block

Posted by Or A on Stack Overflow See other posts from Stack Overflow or by Or A
Published on 2010-05-04T18:07:20Z Indexed on 2010/05/04 23:18 UTC
Read the original article Hit count: 388

Hi,

so the story go like this:

i'm using the Logging Enterprise Application block that provided by microsoft to log events in our application.

The goal is to enabled event viewer logging at loading and then turn it off.

What i did is to add EventLog TraceListener which write all our logs into the event viewer. What i'm trying to do is to disable it after the application was done loading. The only way that i can thing about is to add a LogEnabled Filter and then turn it off.

However, i don't know how to access this filter at run time and disable log on this listener.

if you have an idea, please share.

Thanks

© Stack Overflow or respective owner

Related posts about application-blocks

Related posts about logging