Windows 服务公开 WCF:大多数事件日志条目未出现在事件日志中?
我在一个客户那里遇到了一些非常奇怪的情况,希望我维护他们的一些软件:
在启动/停止时,Windows 服务的事件日志条目正确显示。
但在传入 WCF 调用期间,它们并非如此。
所有 EventLog 创建都通过相同的全局静态工厂类。
当我将所有类放入控制台应用程序时,一切都记录正常。
将这些条目发送到 OutputDebugString 时,会发生同样的情况:Windows 服务启动/关闭正常进行,但 WCF 执行却不然。
我应该从哪里开始挖掘?
I have some very odd situation at a client that wants me to maintain some of their software:
upon start/stop, the EventLog entries of a Windows Service are correctly appearing.
But during incoming WCF calls, they are not.
All EventLog creating is going through the same global static factory class.
When I put all classes in a console app, everything logs fine.
When sending those entiries to OutputDebugString, the same happens: windows Service Startup/Shutdown are coming through fine, but WCF execution not.
Where should I start digging?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这类问题很难解决。我首先将调试器附加到 WCF 服务,并在日志记录类中添加一些断点,然后查看代码是否真正停止。如果没有,请将制动点移至服务并查看为什么它没有进入日志代码。
鉴于代码在控制台应用程序中工作,并且仅部分在 WCF 服务中工作,我的第一个猜测是这可能是线程问题。但没有更多信息,这只是纯粹的猜测。
These kinds of problems are hard to figure out. I would start by attaching the debugger to the WCF service and adding some breakpoints in the logging classes and see if the code actually stops. If not move the brake point to the service and see why it doesn't get into the logging code.
Given that the code works in a console app and only partly in a WCF service my first guess is that it could be a threading issue. But without more info that is just pure speculation.