views:

27

answers:

2

When should I log a message to the event log? Is there an accepted best practice for whether a particular event...

  • Needs to be logged to the event log at all
  • Is an error or a warning
  • Is important enough info to logged as an info event in the event log
+1  A: 

There's no single standard.

  • Log as informational if you have something to say that you think someone might possibly read.
  • Log as a Warning if you have something to say that you think someone should know about.
  • Log as an Error if you have something to say that you think someone should be informed about immediately. An Error should be something that might cause someone to be awakened early in the morning to deal with it.

As you can see from the above, I think you should log when you have something to say.

John Saunders
+1  A: 

This is what I was looking for...

http://msdn.microsoft.com/en-us/library/aa363662%28VS.85%29.aspx

RichAmberale