首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Windows2008 R2和IIS7中,当用户不在管理员组中时,出现写入应用程序事件日志的log4net权限问题

在Windows2008 R2和IIS7中,当用户不在管理员组中时,出现写入应用程序事件日志的log4net权限问题
EN

Stack Overflow用户
提问于 2011-07-09 03:04:26
回答 1查看 8.9K关注 0票数 1

当用户不属于ASP.Net 2008 R2和IIS7中的管理员组时,我从Windows4.0 web应用程序获得了写入应用程序事件日志的log4net权限。我们使用NT身份验证和模拟。一旦我将用户分配到admin组,它就可以正常工作。我尝试了很多权限设置,比如给经过身份验证的用户完全访问注册表中的事件日志等,但都不起作用。如果有人能帮上忙,那就太好了。

当我在Windows2003服务器上从Windows1.1应用程序中记录事件日志时遇到类似的问题时,我按照下面的链接输入CustomSD,它起作用了

http://mossipqueen.wordpress.com/2008/08/04/cannot-open-log-for-source-you-may-not-have-write-access/

下面是我从log4net内部日志中得到的错误。

代码语言:javascript
复制
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)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-07-09 04:56:55

也许我在这里遗漏了一些东西,但它看起来像是该用户的一个简单的权限问题。默认情况下,它们没有写入应用程序日志文件的权限。我知道你玩弄了权限,但我不确定你到底分配了什么权限。

以下是一篇Microsoft文章,介绍了如何通过执行您想要执行的操作来克服您看到的错误:

http://support.microsoft.com/kb/2028427

如果你遵循这一点,你应该解决你的问题。我希望这能帮到你。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6629205

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档