【发布时间】:2011-07-08 19:04:25
【问题描述】:
当用户不在 Windows 2008 R2 和 IIS 7 的管理员组中时,我遇到 ASP.Net 4.0 Web 应用程序写入应用程序事件日志的 log4net 权限问题。我们正在使用 NT 身份验证和模拟。一旦我将用户分配到管理员组,它就可以正常工作。 我尝试了许多权限设置,例如授予 Authenticated Users 对注册表中 Eventlog 的完全权限等,但它们都不起作用。如果有人可以提供帮助,那就太好了。
当我在 Windows 2003 服务器上从 .net 1.1 应用程序记录到事件日志时遇到类似问题时,我按照下面的链接进行了 CustomSD 条目,它起作用了
我得到的错误来自 log4net 内部日志。
log4net:ERROR [EventLogAppender] Unable to write to event log [Application] using source [*******]
System.InvalidOperationException: Cannot open log for source '*******'. You may not have write access. ---> System.ComponentModel.Win32Exception: Access is denied
--- End of inner exception stack trace ---
at System.Diagnostics.EventLogInternal.OpenForWrite(String currentMachineName)
at System.Diagnostics.EventLogInternal.InternalWriteEvent(UInt32 eventID, UInt16 category, EventLogEntryType type, String[] strings, Byte[] rawData, String currentMachineName)
at System.Diagnostics.EventLogInternal.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
at System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
at log4net.Appender.EventLogAppender.Append(LoggingEvent loggingEvent)
【问题讨论】:
标签: asp.net iis-7 log4net event-log