无法打开源日志“blah”。您可能没有写入权限。呃?
我正在尝试写入自定义事件日志...但收到错误:
Win32Exception 访问被拒绝 无法打开源“blah”的日志。您可能没有写入权限。
我已经在网上搜罗了..遵循了各种链接,迄今为止我遇到的最好的链接是 这篇文章。但它并没有想象的那么清楚......
这是一个 2008 R2 开发服务器。 我添加了以下 REG_SZ 键“CustomSD”,其值为 O:袋子:SYD:(A;;0x7;;;AN)(A;;0x7;;;SY)(A;;0x7;;;BA)(A;;0x7;;;SO)(A;; 0x7;;;IU)(A;; 0x7;;;SU)
到注册表文件夹“eventlog”和我的子文件夹。
我还允许每个人完全访问物理事件日志(.evtx 文件)...但一切都无济于事...
我想我正在授予对各种帐户类型的读写和清除访问权限(SY=系统等) ,)。
我的失败网站是在默认的 IISAPPPool 帐户下运行的。
有人有什么想法吗?
提前致谢,
吉姆
I'm, attempting to write to a custom event log .... but I get the error:
Win32Exception Access Is Denied
Cannot open log for source 'blah'. You may not have write access.
I've trawled the net.. followed varions links and to date the best one I've come across is
this one. It's not as clear as it could be though....
This is a 2008 R2 development server.
I've added the following REG_SZ key "CustomSD" with a value of
O:BAG:SYD:(A;; 0x7;;;AN)(A;; 0x7;;;SY)(A;; 0x7;;;BA)(A;; 0x7;;;SO)(A;; 0x7;;;IU)(A;; 0x7;;;SU)
to registry folders "eventlog" and my sub folders.
I've also allowed everyone full access to the physical event log (.evtx file)... but all to no avail...
I think I'm giving Read Write and Clear access to the various account types (SY=System etc,).
My website which fails is running under the default IISAPPPool account.
Anyone any ideas?
Thanks in advance,
Jim
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ASP.NET 在信任度降低的环境中运行。
如果您的事件日志源尚不存在,则必须添加注册表项才能创建它。
但这在信任度降低的环境中行不通。
您应该为正在使用的事件源创建一个安装程序类,然后在部署期间“安装”网站。最快的方法是创建一个“组件”来记录事件,将事件日志组件拖到设计图面上,设置属性,然后选择命令来创建安装程序。
在部署时,您只需针对 Web 应用程序的 DLL 运行“installutil”即可。事件源将在您的 Web 应用程序启动之前创建。
ASP.NET runs in a reduced trust environment.
If your event log source does not already exist, then registry keys will have to be added in order to create it.
But that won't work in the reduced-trust environment.
You should create an installer class for the event source you're using, then "install" the web site during deployment. The fastest way to do this is to create a "Component" to do your event logging, drag an Event Log component onto the design surface, set the properties, then choose the command to create an installer.
At deployment time, you'll just have to run "installutil" against your web application's DLL. The event source will be created before your web application starts.