Friday, January 23, 2009

Event Logs

We can create event logs using System.Diagnostics.

Application Log


EventLog eventLog = new EventLog("Application");
eventLog.Source = "MyApp";
eventLog.WriteEntry("Application Started", EventLogEntryType.Information);
Security Log

EventLog eventLog = new EventLog("Security");
eventLog.Source = "MyApp";
eventLog.WriteEntry("Application Started", EventLogEntryType.Information);

System Log

EventLog eventLog = new EventLog("System");
eventLog.Source = "MyApp";
eventLog.WriteEntry("Application Started", EventLogEntryType.Information);

0 comments:

Post a Comment