English 中文(简体)
为什么我只能看一下我的妇联服务方面的错误?
原标题:Why can t I trace just errors on the service side of my WCF?

我有一个有时会产生错误的阴道服务,如“内冰电信号是可按物体图表顺序排列或脱硫的物品数量最多为65536个”。 我知道如何解决这一特殊问题,但现在我想要制造一个痕迹,只挽救错误(和重大错误)。

问题在于,我的航海志要么拯救一切(包括成功的电话),要么根本不挽救任何东西。 因此,我的问题是,与我的网络有什么错误?

<system.diagnostics>
    <trace autoflush="true" />
    <sources>
        <source name="System.ServiceModel" propagateActivity="true" switchValue="Error">
            <listeners>
                <add name="xml">
                </add>
            </listeners>
        </source>
    </sources>
    <sharedListeners>
        <add initializeData="C:mylog.svclog"
             type="System.Diagnostics.XmlWriterTraceListener"
             name="xml" />
    </sharedListeners>
</system.diagnostics>

我曾尝试过转道的各种不同组合,但我没有看到我所希望的结果(即捕获错误,但不是成功的呼吁)。

是否有任何人的想法?

问题回答

如果你只需要服务边的伐木,你可能要检查IErrorHandler,接口,你可以将其放在服务班上。

这一接口将暴露两种方法

public bool HandleError(Exception error)

public void ProvideFault(Exception error, MessageVersion ver, ref Message msg)

这将使你能够利用在服务领域出现的所有例外——将这些例外记录在你自己的记录中,而且你应当被罚款。





相关问题
Best logging approach for composite app?

I am creating a Composite WPF (Prism) app with several different projects (Shell, modules, and so on). I am getting ready to implement logging, using Log4Net. It seems there are two ways to set up the ...

How to make logging.debug work on Appengine?

I m having a tough time getting the logging on Appengine working. the statement import logging is flagged as an unrecognized import in my PyDev Appengine project. I suspected that this was just an ...

How to validate Java logging properties files?

I have a basic facility for allowing users to remotely apply changes to the logging files in my application. Some logs are configured using java.util.logging properties files, and some are configured ...

Logging SAS scripts

I ve been developing a lot of Java, PHP and Python. All of which offer great logging packages (Log4J, Log or logging respectively). This is a great help when debugging applications. Especially if the ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

热门标签