从 BizTalk 写入事件日志

发布于 2024-12-12 00:12:02 字数 224 浏览 1 评论 0原文

当我尝试使用表达式形状中的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

零度℉ 2024-12-19 00:12:02

当您从任何应用程序写入事件日志时,需要已经创建事件源,否则应用程序本身将在写入之前尝试创建它。不幸的是,创建事件源是一项需要本地管理员权限的操作。

因此,您可以做两件事:

  1. 预创建事件源
  2. 确保您的 biztalk 主机正在运行的用户与本地管理员一样(不好)

预创建事件源是一个更好的选择。您可以通过 powershell 命令执行此操作

New-EventLog -LogName "Application" -Source "MyEsb" 

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:

  1. pre-create the event source
  2. make sure the user which your biztalk host is running as is in local admins (bad)

To pre-create the event source is a nicer option. You can do this via the powershell command

New-EventLog -LogName "Application" -Source "MyEsb" 
无人问我粥可暖 2024-12-19 00:12:02

我似乎在陈述显而易见的事情,但是 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

碍人泪离人颜 2024-12-19 00:12:02

最后我找到了解决方案。正如错误所述,“要创建源,您需要读取所有事件日志的权限,以确保新源名称是唯一的。无法访问的日志:安全性。”因此,即使 BizTalk 用户帐户具有有足够的权限写入事件日志,但没有权限读取 EventLog\Security 日志,如所述 此处在备注部分的注释中:

此要求的原因是必须搜索所有事件日志(包括安全性)以确定事件源是否唯一。从Windows Vista开始,用户无权访问安全日志;因此,会抛出 SecurityException。

因此,我刚刚为 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:

The reason for this requirement is that all event logs, including security, must be searched to determine whether the event source is unique. Starting with Windows Vista, users do not have permission to access the security log; therefore, a SecurityException is thrown.

So I just granted a Read Access to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\Security for BizTalk User and the problem was solved.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文