问题访问/写入到EventLog [英] Problem in accessing/writing to EventLog

查看:166
本文介绍了问题访问/写入到EventLog的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我和一些老code工作(坦白地说,我不知道一半是做什么的),试图将其移动到IIS7。

I'm working with some old code (and frankly I don't know half of what it does) trying to move it over to IIS7.

一个我看到的问题是,我得到这个错误:

One of the problems I see is that I get this error:

[SecurityException异常:源未找到,但一些或所有事件日志不能被搜索到。不可访问的日志:安全]

[SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.]

如果我手动去HKEY_LOCAL_MACHINE \\系统\\ CurrentControlSet \\服务\\事件日志\\安全,并设置关键的(安全)权限,让每个人有充分的上网本消失没有问题。但很明显,这不是最佳的解决方案。

If I go manually to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Security and set that key's (Security) permission to let "Everyone" have full access this goes away no problem. But obviously that's not the optimal solution.

任何人都知道的更好的方法来消除这种例外?

Anyone know of a better way to remove this exception?

推荐答案

解决这个问题的方法之一是运行在完全信任写入违规源名称在一个单一的事件日志条目的简单的控制台应用程序。你必须为每个服务器做到这一点的一次的。

One way to fix this is to run a simple console application under full trust that writes a single EventLog entry under the offending source name. You'll have to do this once for each server.

从这一刻起,你应该能够登录该源名下。 (至少是我的观察。)这只是的创建的未知来源,你不能从ASP.NET下做的,登录到一个现有的来源不应该是一个问题。

From that moment on, you should be able to log under that source name. (at least that's been my observation.) It's just creating an unknown source that you cannot do from under ASP.NET, logging to an existing source should not be a problem.

问题是:你知道的源名称?如果你不这样做,暂时准许访问每个人,等待日志消息,并消除大家也应该工作。

Question is: do you know the source name? If you don't, temporarily granting access to Everyone, wait for a log message, and removing Everyone should also work.

在微软官方的方法是创建一个注册了一个事件日志源的安装程​​序。

The official Microsoft way is to create an installer which registers an Event Log Source.

这篇关于问题访问/写入到EventLog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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