Tutorial :Robust Event Logging


This seems, to me, a slightly more specific question that those already asked, so: How reliable is the Windows Event Log service if I'm looking for a 'fire and forget' logging service, so that even an error in calling the service does not impact the caller, and is noted somewhere, somehow, by the OS?


On Windows side, the event log is fine. Being used for so long by so many applications, it is definitely stable. I'm sure you can find creative ways to crash the API by feeding it bad enough input, but that's probably true with every API. When used properly it will work.

Having that said, you usually don't use the event log in a "fire and forget" context. Keep in mind it is a system-global log, which is supposed to be read by an administrator. Being fed too many events, it will become quite useless from the administrator's point of view. If you do use it sparsely and only for significant events, you can take your time and make sure your input is valid and no exceptions propagate back to your main logic.

Lastly, if you're looking for a real "fire and forget" logging infrastructure, take a look at ETW, which is a high performance event tracing infrastructure that is built into Windows.


In my experience, I have never had a programmatic issue with the Event Service. I did have an issue once, but it was a 4201(?) 'Access Denied' error caused by the Platforms "gurus" at my shop. But never anything regarding any usage or API calls.


The Windows event log has worked well for us in practice. The only problems that we had regarding stability were in the days of NT4 and are long gone in practice. Just make sure that you don't flood it with the same event repeatedly or it becomes a pain to actually look at ;)

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