我想写入默认的应用程序事件日志,而不是自动创建事件日志源或通过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.