EventLog
-
I'm having a hell of a time using the EventLog class within a windows Service. The service runs fine...no errors but does not write to my custom event log. The service is running with LocalSystem Account privilages and I'm logged on as an admin. Here is the code I am using:
public const string EventLogSource="BLOBUpdateService";
public const string EventLogName="BLOBUpdateEventLog";
..
..
..
..//init Event Log
m_Log = new EventLog();
if(!EventLog.SourceExists(EventLogSource))
EventLog.CreateEventSource(EventLogSource,EventLogName);
m_Log.Source=EventLogSource;
m_Log.WriteEntry("Service Started...",EventLogEntryType.Information);Nothing is getting written to the log. Any thoughts ?
-
I'm having a hell of a time using the EventLog class within a windows Service. The service runs fine...no errors but does not write to my custom event log. The service is running with LocalSystem Account privilages and I'm logged on as an admin. Here is the code I am using:
public const string EventLogSource="BLOBUpdateService";
public const string EventLogName="BLOBUpdateEventLog";
..
..
..
..//init Event Log
m_Log = new EventLog();
if(!EventLog.SourceExists(EventLogSource))
EventLog.CreateEventSource(EventLogSource,EventLogName);
m_Log.Source=EventLogSource;
m_Log.WriteEntry("Service Started...",EventLogEntryType.Information);Nothing is getting written to the log. Any thoughts ?
I solved my problem. I started to use the static EventLog.WriteEvent method rather than using an instance of the class.