Is it possible to create an Event ID linked to an error from C# debugging system?
I'm currently writing my code -which still has a small error, click here- for making up really detailed error logs in the event viewer
Is it possible to create an Event ID linked to an error from C# debugging system?
I'm currently writing my code -which still has a small error, click here- for making up really detailed error logs in the event viewer
If you want to create an event source you must create it if don't exist :
string cs = "CustomSource";
EventLog elog = new EventLog();
if (!EventLog.SourceExists(cs))
EventLog.CreateEventSource(cs, cs);
int eventID = 8;
elog.Source = cs;
elog.EnableRaisingEvents = true;
elog.WriteEntry(message, System.Diagnostics.EventLogEntryType.Error,
eventID);