Understanding Priority and Severity

Topics: Logging Application Block
Apr 30, 2009 at 12:11 AM
Edited Apr 30, 2009 at 3:08 AM
Every logging system I know of uses the "severity" concept (error, warning, information, etc)...but I've never heard of that metric used in conjunction with an additional metric (in this case, "priority").  Unfortunately, the EntLib documentations makes absolutely no comment on the rationale or suggested use for the additional "priority" data, and a search on this forum for the keywords "priority severity" returns too many hits for tractable research (so I'm not finding the help I'm looking for).

Even more perplexing is that the priority parameter, compared to severity parameter, respectively dominates "12 to 6" of the 19 Logger.Write overloads.  That suggests priority is considered more important than severity.  Yet if it is more important, why is nothing said about it in the documentation?

The longest description and philosophical commentary I've found regarding EntLib "priority," is a single phrase on codeproject which says "priority: used to filter log entries." http://www.codeproject.com/KB/architecture/GetLoggingWithEntLib.aspx

This whole matter would be less perplexing if the "favoritism" in the Logger.Write overloads were reversed to emphasize severity.  As is, without that reversal, the interface doesn't seem practical to use directly (i.e. a wrapper should supply overloads that reverse precedence between the two properties).

Can anyone supply the missing rationale for having both "severity" and "priority" (instead of "severity" alone)?  And can anyone suggest an example strategy of how to use them together?  Hopefully someone has an explanation that would illuminate why I might list an event as being "Critical" severity, but only minimal priority, or why I might have a "Debug" severity, with maximum priority.  Curious...
Apr 30, 2009 at 9:00 AM
My explanation is not specific to entlib's usage of these two items, this is just my opinion.  I'll just be comparing it to how we use them in work item tracking.  You could have a less severe error but needs to be prioritized as it is what's in the current scope of what you're currently working on and thus, needs to be delivered working 100%.  (At the same time, you could have a severe error but you also need to prioritized other items as again, the affected component of that error is not yet expected to be fully working.)  

Thus, not all of the severe errors should be given the topmost priority.  Filtering log entries by priority would call your attention to any errors, warnings, etc. which are present in areas which are not supposed to have at the moment.  Like in a case where you are expected to deliver a certain service component 98% working, you would need to give high priorities to logs generated by that component.

Hope this gave you some insight. 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
Apr 30, 2009 at 8:44 PM
Fantastic!  Yes, your usage example does give a sensible picture for having both metrics (priority and severity).  I thank you for posting this.  Perhaps some kind of comment(s) could be added to the official documentation.

I suppose I should turn one my previous questions into a request: I think Logger.Write should have an additional method "Logger.SevWrite" having overloads placing emphasis on severity.  For example, it would be wonderful to code:

  Logger.TypeWrite("MyMessage", TraceEventType.Error);
  Logger.TypeWrite("AnotherMessage", TraceEventType.Warning, "MyCategory");
  Logger.TypeWrite("Hello World", TraceEventType.Information, 3);  //the '3' is the 'priority'
  //...other overloads that emphasize trace event type...

In other words, its very helpful to specify TraceEventType without needing to supply priority or 4 or 5 other parameters.  I can certainly provide my own wrapper to do this, but it seems this should be directly part of the Logging Application Block.  Thoughts?
May 4, 2009 at 8:55 AM
The best way would be to vote for your feature request here - http://blogs.msdn.com/agile/archive/2009/03/27/enterprise-library-5-0-tentative-product-backlog-published-story-feature-prioritization-is-open-your-participation-is-invited.aspx  for the next release of enterprise library.  Hope this helps. :)

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.