How to suppress adding of Tracer categories to in scope calls to Logger.Write()?

Topics: Logging Application Block
Dec 30, 2008 at 11:41 PM
"The categories associated with a Tracer object remain in effect as long as the Tracer object remains in scope. This means that the categories for a Tracer object are included in the list of categories for any call to the Logger.Write method while that Tracer object is in scope."  Copied from

Is there any way to disable this behavior for the in scope Logger.Write calls?

Jan 2, 2009 at 4:48 AM
Derive the class from TraceListener. You should be able to override the methods.
Jan 7, 2009 at 5:49 PM
Thanks for your response but I'm using a number of the built-in listeners so I'd like to avoid writing multiple custom trace listeners and having to reinvent the functionality of the built-in trace listeners.

Does anyone know of a configuration setting which will disable this behavior for the built-in trace listeners?
Jan 8, 2009 at 3:43 AM

I cant seem to find a way that will disable that behavior, however, you can try setting the "SourceLevels" Property of the category that you'll pass to the Tracer to "ActivityTracing", so that it will only accept ActivityTracing related logs.

Hope this Helps.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
Jan 9, 2009 at 12:11 AM
That worked, thanks Valiant!