Simple EventLog entry writing
The following one-liner writes to the Application event log in both debug and release modes. The documentation does a great job of making it seem much more complicated…until you notice that half the overloads for WriteEntry are static:
EventLog.WriteEntry("
A “source” is an arbitrary string which will appear prominently in the event log’s event list view. A source can be registered which allows you to specify exactly which log you want to write to and is presumably a great idea for high volume logging. A source will automatically be registered with the Application log if it is used to write an event before being registered.