zoukankan      html  css  js  c++  java
  • 如何使用svconfigeditor.exe编辑WCF Service配置文件配置Diagnostics进行WCF Service的log和Trace(三)

    WCF service具备强大的debug和trace功能,本节将介绍WCF service Diagnostic的配置

    打开svcconfigeditor后,有关diagnostics的screenshot如下所示:

    下面一一介绍:

    1.1  performance counter

    Specifies whether performance counters for the assembly are enabled. Valid values are

    • Off: Performance counters are disabled.
    • ServiceOnly: Only performance counters relevant to this service is enabled.
    • All: Performance counters can be viewed at runtime.
    • Default: A single performance counter instance _WCF_Admin is created. This instance is used to enable the collection of SQM data for used by the infrastructure. None of the counter values for this instance are updated and therefore will remain at zero. This is the default value if no configuration is present for WCF.

    eg.当将其设置为off时, WCf service开始运行时,perfom仍然无法添加其对应的performance couter.当将其设置为ServiceOnly或者All时,即可以看到运行时的该service的相对应的WCF service instance.

    如下图所示:

    其中,http://yaweiw-64/service  为该服务metadata地址,mymath为该service的一个endpoint. 

    1.2 messageLogging

    This element defines the settings for the message-logging capabilities of Windows Communication  Foundation (WCF). (详细信息请参阅http://msdn.microsoft.com/en-us/library/ms731308.aspx

    如果要对所有service写入log, 那么必须enable messageLogging即可

    该配置screenshot如下所示:

    messageLogging中相应element和attrible意义如下表所示:

    属性 说明

    logEntireMessage

    一个布尔值,指定是否记录整个消息(消息头和正文)。默认值为 false,这意味着仅记录消息头。此设置会影响所有消息日志记录级别(服务、传输和格式不正确)。

    logMalformedMessages

    一个布尔值,指定是否记录格式不正确的消息。格式不正确的消息将不计入 maxMessagesToLog。默认值为 false

    logMessagesAtServiceLevel

    一个布尔值,指定是否在服务级别跟踪消息(在与加密和传输有关的转换之前)。默认值为 false

    logMessagesAtTransportLevel

    一个布尔值,指定是否在传输级别跟踪消息。配置文件中指定的所有筛选器都会应用,但仅跟踪与这些筛选器相匹配的消息。默认值为 false

    maxMessagesToLog

    一个正整数,指定要记录的最大消息数。默认值为 1000。

    maxSizeOfMessageToLog

    一个正整数,指定要记录的最大消息大小(字节)。大小超出限制的消息将不会被记录。此设置会影响所有跟踪级别。默认值为 262144 (0x4000)。

     经过以上配置,当service启动之后,所有访问service都被Log至所指定的文件中。

    1.3 Tracing

    tracing配置screenshot如下所示:

    生成的xml config segment如下所示:

    Code
  • 相关阅读:
    梦想总是要有的,万一实现了呢?(转)
    registered the JBDC driver [oracle.jdbc.OracleDriver] but failed to unregister it when the web application was stopped. (转)
    Memory Leak(内存泄漏)问题总结(转)
    单元测试(UT)、功能测试(FT)(转)
    算法——动态规划篇——最长公共子序列
    设计模式总结
    C/C++基本数据类型所占字节数
    extjs tree check 级联选择
    骨骼动画具体解释
    java设计模式演示样例
  • 原文地址:https://www.cnblogs.com/Winston/p/1322317.html
Copyright © 2011-2022 走看看