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


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>

你可能感兴趣的:(WCF web log can be logged via setting its web.config)