From auWiki
Jump to: navigation, search

C# class that reports a message to the Windows event log (for services without a user interface).





Services can create an object from this class and use it to report messages into the Windows Application Event Log. The object should be of type Reporter even though the EventLogReporter constructor is used, in order to more easily switch between other types of reporters.

Public Methods

new EventLogReporter

EventLogReporter(string eventSource)

Creates an EventLogReporter object, and adds the specified event source to the Windows Application Event Log if it doesn't already exist.

  • eventSource = Text to show in the source column of the event viewer.


void Report(string title, string message, string debugDetail, MessageType mType)

Reports a message to the Windows Application Event Log. Overrides Reporter.Report()

  • title = Beginning of event log message.
  • message = The actual message, user-friendly.
  • debugDetail = Details to display at end of message.
  • mType = Type of message being reported.