I try to write new log to MyLog but it always writes to Application Log (Windows Log)
string sSource;
string sLog;
sSource = "MySource";
sLog = "MyLog";
if (!EventLog.SourceExists(sSource))
EventLog.CreateEventSource(sSource, sLog);
using (EventLog eventLog = new EventLog(sLog))
{
eventLog.Source = sSource;
eventLog.WriteEntry("Log message example", EventLogEntryType.Information, 101, 1);
}
I tried to delete the log entry on Registry to recreate the log but the problem still persists.
Ty any help.