【问题标题】:WCF Message LoggingWCF 消息记录
【发布时间】:2010-12-01 23:04:41
【问题描述】:

我正在使用 WCF 访问一些 Web 服务,并且我正在尝试确定少数几个中哪一个是最有效的。我启用了消息日志记录以尝试获取有关它们运行情况的更多信息,但由于某种原因,.svclog 文件似乎没有生成,我很难过。据我所知,一切都设置好了,我在服务配置编辑器的诊断选项卡中启用了消息日志记录,并在侦听器中设置了输出文件名/路径。

【问题讨论】:

    标签: .net wcf logging


    【解决方案1】:

    这里是正确记录的 web.config 文件的一部分:

      <system.diagnostics>
        <sources>
          <source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing">
            <listeners>
              <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                <filter type="" />
              </add>
              <add name="ServiceModelMessageLoggingListener">
                <filter type="" />
              </add>
            </listeners>
          </source>
        </sources>
        <sharedListeners>
          <add initializeData="c:\TEMP\web_messages.svclog"
            type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
            name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
            <filter type="" />
          </add>
        </sharedListeners>
      </system.diagnostics>
    

    你有类似的吗?是否正确设置了 initializeData 属性,如果您将其托管在 IIS 中,IIS 可以将其写入某个位置?

    【讨论】:

      猜你喜欢
      • 2011-01-08
      • 2010-10-28
      • 1970-01-01
      • 2012-03-08
      • 2011-12-24
      • 2014-12-19
      • 1970-01-01
      • 1970-01-01
      • 2020-04-15
      相关资源
      最近更新 更多