log4net的权限问题写入应用程序事件日志,当用户不在管理员组在Windows 2008 R2和IIS 7 [英] log4net permission issue to write to application event log when the user is not in admin group in Windows 2008 R2 and IIS 7

查看:934
本文介绍了log4net的权限问题写入应用程序事件日志,当用户不在管理员组在Windows 2008 R2和IIS 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有写信给应用程序事件日志中,当用户不在管理员组中的Windows 2008 R2和IIS 7,我们正在使用NT身份验证和模拟从ASP.Net 4.0 web应用log4net的权限问题。有一次,我分配用户管理员组正常工作。
我试图想给身份验证的用户完全权限到EventLog注册表等多种权限设置,没有他们的工作。如果任何人能帮助这将是巨大的。

当我有记录一个类似的问题从.NET 1.1的应用程序到EventLog在Windows 2003服务器我做CustomSD条目下面的链接,它的工作

<一个href=\"http://mossipqueen.word$p$pss.com/2008/08/04/cannot-open-log-for-source-you-may-not-have-write-access/\" rel=\"nofollow\">http://mossipqueen.word$p$pss.com/2008/08/04/cannot-open-log-for-source-you-may-not-have-write-access/

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

  log4net的:ERROR [EventLogAppender]无法使用源写入事件日志[应用] [*******]
System.InvalidOperationException:无法打开日志源'*******。您可能没有写访问。 ---&GT; System.ComponentModel.Win32Exception:访问被拒绝
   ---内部异常堆栈跟踪的结尾---
   在System.Diagnostics.EventLogInternal.OpenForWrite(字符串currentMachineName)
   在System.Diagnostics.EventLogInternal.InternalWriteEvent(UInt32的EVENTID,UINT16类,EventLogEntryType类型的String []字符串,字节[] RAWDATA,字符串currentMachineName)
   在System.Diagnostics.EventLogInternal.WriteEntry(字符串消息,EventLogEntryType类型的Int32 EVENTID,Int16的类别,字节[] RAWDATA)
   在System.Diagnostics.EventLog.WriteEntry(源字符串,字符串消息,EventLogEntryType类型的Int32 EVENTID,Int16的类别,字节[] RAWDATA)
   在log4net.Appender.EventLogAppender.Append(LoggingEvent所LoggingEvent所)


解决方案

也许我失去了一些东西,但它看起来像一个简单的权限问题该用户。默认情况下它们不能访问写入到应用程序的日志文件。我知道你发挥各地的权限,但我不知道到底是什么权限您分配。

下面是正是做你想做的事,克服你所看到的错误,那么微软的文章:

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

如果你遵循这一点,你应该解决您的问题。我希望这有助于。

I am having log4net permission issue from ASP.Net 4.0 web application to write to application event log, when the user is not in administrator group in Windows 2008 R2 and IIS 7. We are using NT authentication and impersonation. Once I assign the user to admin group it works fine. I tried with many permission settings like giving Authenticated Users full permission to Eventlog in registry etc. and none of them work. If any one can help that will be great.

When I had a similar issue with logging to eventlog from a .net 1.1 app on Windows 2003 server I did CustomSD entry as below link and it worked

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

The error I get is below from log4net internal log.

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)

解决方案

Maybe I'm missing something here but it looks like a simple permissions issue for that user. By default they don't have access to write to the application log file. I know you played around with the permissions but I'm not sure exactly what permissions you assigned.

Here is a Microsoft article on doing exactly what you want to do to overcome the error you are seeing:

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

If you follow this, you should solve your issue. I hope this helps.

这篇关于log4net的权限问题写入应用程序事件日志,当用户不在管理员组在Windows 2008 R2和IIS 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆