Logging: DefaultCategory value not used in EntLib 3.1

Topics: General discussion, Logging Application Block
Mar 14, 2008 at 8:44 PM
In our project, we are using Module Name as category so that we can control logging for each module separately. But we don't want to create category sections for each module we might get to ~60 modules. So ideally we want to Logging Block "DefaultCategory" attribute, so that if specified category is not present, Logging block will use the category specified in "DefaultCategory".

But this is not working.

I can not use "All Events" as catch all - because I already use this with "Critical" flag - so that all "Critical" events -irrespective of module goes here for email/event log listeners.

In this case there is no error - So I can not use "Errors & Warnings" - I already have this section pointing to Event Log and it works when they are errors.

Please let me knwo if "DefaultCategory" is not best option in EntLib 3.1 - is there a better option for this. My only other choice is to do the mapping of Module to category through some external mapping to handle this. But don't like any custom solution if EntLib already supports this.
Mar 21, 2008 at 3:41 PM

The default category is used when you do not specify a category. This might be what you're looking for if the decision of which modules get their own category is fairly static.

However, the "Unprocessed" category seems to be a better fit. It will get the entries for which the specified category isn't found in the configuration file (or better said, it will get the entries for which at least one of the specified categories isn't found).