WCF web log can be logged via setting its web.config

来源:互联网 发布:信息推广软件 编辑:程序博客网 时间:2024/06/17 22:11


in its web.config. you can add the following items,  all actions will be logged into the file C:\Program Files\web_messages.svclog. you can open it with a tool "Microsoft  sErvice trace viewer" tool 

<?xml version="1.0"?>

<configuration>
<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:\Program Files\web_messages.svclog"
               type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
               name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
    <filter type="" />
           </add>
      </sharedListeners>
<trace autoflush="true" />
  </system.diagnostics>
原创粉丝点击