using System.Diagnostics;/// /// This class helps to log messages. Currently it is logging to Event Log/// public static class Logger{ /// /// Application Event log name /// public const string SourceName = "EventLogger"; /// /// Initialize the logger. This will check the Eventsource exists or not, if not exits, creates it. /// public static void Initialize() { if (!EventLog.SourceExists(SourceName)) { EventLog.CreateEventSource(SourceName, SourceName); } } /// /// Logs the entry. /// /// The message to be logged. public static void LogEntry(string message) { EventLog.WriteEntry(SourceName, message); }}