0
我嘗試寫新日誌MyLog但它總是寫入應用程序日誌(登錄Windows)無法事件日誌寫入指定的日誌
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);
}
我試圖刪除註冊表中的日誌條目重新創建日誌但問題仍然存在。
有任何幫助。
它劇照保存到應用程序日誌,真的很奇怪。 –
有人有一個simmilar問題在這裏:https://stackoverflow.com/questions/31114998/eventlog-logs-in-application-even-though-set-to-another-log –
謝謝,我必須重新啓動機器才能獲得它重新映射。真的很混亂的系統。 –