从 BizTalk 写入事件日志
当我尝试使用表达式形状中的 EventLog.WriteEntry("MyEsb", "Msg");
之类的内容执行编排时,我收到异常 The source was not found, but some or无法搜索所有事件日志。要创建源,您需要读取所有事件日志的权限,以确保新源名称是唯一的。无法访问日志:安全性。
为什么? 如果这有意义的话,我正在运行 Win 7 64 位。
When I try to execute an orchestration with something like EventLog.WriteEntry("MyEsb", "Msg");
in Expression shape, I get the exception The source was not found, but some or all event logs could not be searched. To create the source, you need permission to read all event logs to make sure that the new source name is unique. Inaccessible logs: Security.
Why?
I'm running Win 7 64bit if this makes any sense.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当您从任何应用程序写入事件日志时,需要已经创建事件源,否则应用程序本身将在写入之前尝试创建它。不幸的是,创建事件源是一项需要本地管理员权限的操作。
因此,您可以做两件事:
预创建事件源是一个更好的选择。您可以通过 powershell 命令执行此操作
When you write the event log from any application, the event source needs to be already created, or the application itself will try to create it before writing to it. Unfortunately, creating an event source is an action which requires local admin priveledges.
So you can do two things:
To pre-create the event source is a nicer option. You can do this via the powershell command
我似乎在陈述显而易见的事情,但是 BizTalk 用户 是否获得了写入事件日志的权限?即运行编排的主机实例的帐户。
您可能会发现事实并非如此。
华泰
Might seem like I'm stating the obvious but has the BizTalk User got permission to write to the Eventlog? That is, the account of the Host Instance running the Orchestration.
You'll probably find that it hasn't.
HTH
最后我找到了解决方案。正如错误所述,“要创建源,您需要读取所有事件日志的权限,以确保新源名称是唯一的。无法访问的日志:安全性。”因此,即使 BizTalk 用户帐户具有有足够的权限写入事件日志,但没有权限读取 EventLog\Security 日志,如所述 此处在备注部分的注释中:
因此,我刚刚为 BizTalk 用户授予了对 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\Security 的读取访问权限,问题就解决了。
Finally I've found a solution. As the error says, "To create the source, you need permission to read all event logs to make sure that the new source name is unique. Inaccessible logs: Security." So even though BizTalk User account has enough rights to write to the eventlog it has no rights to read EventLog\Security log as stated here in a Note in the Remarks section:
So I just granted a Read Access to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\Security
for BizTalk User and the problem was solved.