Query on using enterprise library For logging

Topics: Logging Application Block
Apr 9, 2009 at 7:05 PM
I am planning to use Microsoft enterprise library's Logging application block  in my project for error logging for debugging and monitoring purpose.
I wanted to ask that out of the 6 log sinks, I want to use either Event Log or Flat file log.
Please suggest what will be the best way for logging.
ALso If the suggestion is to use event log, then is there any specific process or best practices to be followed , like creating my own EWvent Log name etc.
Apr 12, 2009 at 4:30 PM

IMHO, I would prefer the straight-forward approach for logging as discussed here : http://msdn.microsoft.com/en-us/library/dd139943.aspx . Also, you can consider creating your own Event Log if you want that your application has its own log destination in the eventviewer. I found a post that give's some tips regarding logging, please have a look, http://stackoverflow.com/questions/673575/what-are-the-best-practices-for-logging-an-enterprise-application . 

Valiant Dudan
Global Technology & Solutions
Avanade, Inc.
Apr 13, 2009 at 3:23 PM
From the answer posted in the link above, I understand that I should use EventLog for logging.
Please confirm.
Apr 14, 2009 at 3:55 AM
This would be my opinion too.  If there are a lot of events being monitored and logged in the event log, I suggest you just use the flat file tracelistener.  In addition, other environment like Windows Server2003, the default permission settings won't allow you to log in the event log so you would have to modify it.  And as mentioned in the msdn link posted above,  if you have a custom event log a registry key should be set in order to create that custom event log.  On the other hand, you can access event logs remote and there are tools which you can directly use against an event log for various purposes.  So the decision totally depends on you, your requirement or if you're not sure, just go for what you're comfortable with. 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.