繁体   English   中英

使用模拟时编写事件日志

[英]Write eventlog while using impersonation

由于某些原因,当我在web.config中使用模拟选项时。 一切都很好,但是一个困扰我的问题是,使用System.Diagnostics.TraceSource写入事件日志时发生以下错误:

System.Web.HttpUnhandledException (0x80004005): 
Exception of type 'System.Web.HttpUnhandledException' was thrown. 
---> System.ComponentModel.Win32Exception (0x80004005): 
Access is denied at System.Diagnostics.EventLogInternal.InternalWriteEvent(UInt32 eventID, UInt16 category, EventLogEntryType type, String[] strings, Byte[] rawData, String currentMachineName) 
at System.Diagnostics.EventLogInternal.WriteEvent(EventInstance instance, Byte[] data, Object[] values) 
at System.Diagnostics.TraceSource.TraceEvent(TraceEventType eventType, Int32 id, String message)

有人给我一些建议吗? 提前致谢。

被模拟的用户没有写事件日志的权限。

我建议您使用任何用户都具有写访问权限的TraceListener(例如,目录完全打开的文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM