Alphashack.Graphdat.Agent.HttpModule.SetupEventLog C# (CSharp) Method

SetupEventLog() static private method

static private SetupEventLog ( ) : void
return void
        internal static void SetupEventLog()
        {
            if (EventLog.SourceExists(EventLogSource))
            {
                var eventLog = new EventLog { Source = EventLogSource };
                if (eventLog.Log != EventLogName)
                {
                    EventLog.DeleteEventSource(EventLogSource);
                }
            }
            if (!EventLog.SourceExists(EventLogSource))
            {
                EventLog.CreateEventSource(EventLogSource, EventLogName);
                EventLog.WriteEntry(EventLogSource, String.Format("Event Log Created '{0}'/'{1}'", EventLogName, EventLogSource), EventLogEntryType.Information);
            }
        }