写入自定义事件日志时出现问题 [英] Problem writing to a custom event log

查看:87
本文介绍了写入自定义事件日志时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我已经开发了一个Windows服务(可以工作),不过我遇到的问题是b $ b写入自定义事件日志。我已经设法为我的服务创建一个事件
源并将其注册到我的自定义日志(在
注册表中双重检查)但我不断在Application
日志中出现以下消息(没有任何内容写入自定义日志):



源(EmailForwarder)中事件ID(0)的描述不能找到
。本地计算机可能没有必要的注册表信息或
消息DLL文件来显示来自远程计算机的消息。你可以用
来使用/ AUXSOURCE =标志来检索这个描述;有关详细信息,请参阅帮助和支持
。以下信息是事件的一部分:电子邮件转发器
服务运行



要添加到上面,我的服务作为LocalSystem帐户运行,
应该给我完全的访问权限。和注册表项:
HKEY_LOCAL_MACHINE \SYSTEM\CurrentControlSet \ Services \ Eventlog\SmartLogs \ EmailForwarder \ EventMessageFile - >指向
EventLogMessages.dll。



任何帮助将不胜感激!!



谢谢。

Hi,

I have developed a windows service (which works), however the problem I'm having is writing to a custom event log. I have managed to create an event source for my service and register it to my custom log (double checked this in the registry) but I keep getting the following message appearing in the Application log (nothing gets written to the custom log):

The description for Event ID ( 0 ) in Source ( EmailForwarder ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Email Forwarder Service Running

To add to the above, my service is running as the LocalSystem account which should give me full access rights. And the registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\SmartLogs\EmailForwarder\EventMessageFile --> is pointing to EventLogMessages.dll.

Any help will be much appreciated!!

Thanks.

推荐答案

您可以发布用于写入事件日志的代码吗?我认为问题在于你正在调用一个重载,假设你传递的是消息ID而不是字符串消息,所以它无法找到消息资源并产生上述错误。

Could you post the code you are using to write to the event log?  I believe the problem lies in the fact that you are calling an overload that is assuming that you are passing it a message ID rather than a string message so it can't find the message resource and is generating the above error.

Michael Taylor - 10/23/06

Michael Taylor - 10/23/06


这篇关于写入自定义事件日志时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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