Tutorial :Standard for Windows Event Logging: Log nothing vs. Info vs. Warning vs. Error?



Question:

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


Solution:1

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.


Solution:2

This is what I was looking for...

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


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »