[英]Remote Service Trace Listener while logging System.ServiceModel
In our project we need to transmit the client side logging to a server. 在我们的项目中,我们需要将客户端日志记录传输到服务器。 Server-side, we created a WCF service that can receive the logging lines and dump them into a flat file/xml file/database (not important).
在服务器端,我们创建了一个WCF服务,该服务可以接收日志记录行并将其转储到平面文件/ xml文件/数据库中(不重要)。 Client-side, we created a RemoteTraceListener (with attributes to configure the endpoint, etc) calling that logging service.
在客户端,我们创建了一个RemoteTraceListener(具有配置端点的属性等)来调用该日志记录服务。 We use the standard .Net tracing with trace sources (TraceData, TraceEvent) to create the logging.
我们使用带有跟踪源(TraceData,TraceEvent)的标准.Net跟踪来创建日志记录。
Now, this all goes well, unless we hook up the RemoteTraceListener to the "System.ServiceModel" trace source at the client to investigate other service calls. 现在,一切顺利,除非我们在客户端将RemoteTraceListener连接到“ System.ServiceModel”跟踪源以调查其他服务调用。 This obviously goes very wrong.
这显然是非常错误的。
And after that, the messages just keep flooding. 之后,这些消息只会不断泛滥。 Ideas on solving this recursion, please?
请问有解决此递归的想法吗?
After thorough searching, the possible solutions split itself in three categories: 彻底搜索后,可能的解决方案将自己分为三类:
We chose to follow the last method. 我们选择遵循最后一种方法。 We have rewritten our TraceListener to write internally to a queue.
我们已经重写了TraceListener以便在内部写入队列。 Internally a second AppDomain is started, dequeuing and transmitting the logging to the server.
内部启动第二个AppDomain,将日志出队并传输到服务器。 This can be written in half a day.
这可以在半天之内完成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.