LogEntries filtered out incorrectly

Topics: Logging Application Block
Feb 13, 2008 at 8:15 PM

I'm using EL 3.0 Logging Block. I have some Instrumentation categories that are normally filtered out in config file.
In my code, when I write to a regular log after creating a new Tracer for Instrumentation category, my regular log gets filtered out too!


using (new Tracer("InstrumentationCategory", "Message"))
Logger.Write("Message One", "Category1");

In Logging Block LoggerWriter.cs file, public void Write(LogEntry log) there is code that adds Tracing categories to your logEntry

if (structureHolder.TracingEnabled)
replacementDone = AddTracingCategories(log, replacementDone);

That adds "InstrumentationCategory" to my regular log. Then it goes into ShouldLog(log) method and
drops LogEntry if AT LEAST ONE CATEGORY in the list is filtered.

"InstrumentationCategory" is filtered out in my config, so because all my Logger.Write() entries are written after new Tracer("InstrumentationCategory") line, ALL my log entries get ignored!!

Is there a way to make it write to all categories in the list that are NOT included in the filter without change to EL code?

Thank you.