2
我想寫入默認的應用程序事件日誌而無需自動創建事件日誌源或通過EventLog.CreateEventSource
。該程序可能以非管理員身份運行,無法創建事件日誌源。此應用程序沒有安裝程序。在這種情況下,我可以指定哪些來源「始終有效」?在不創建源的情況下寫入應用程序日誌
以供參考,該錯誤信息是:
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. To create the source, you need permission to read all event logs to make sure that the new source name is unique. Inaccessible logs: Security.