How to configure SERVICE TRACE VIEWER in WCF?
Configuring Service trace viewer can be very easily done.
Add the following section in the web.config file to setup trace viewer
1. Add diagnostics section inside system.serviceModel
Add the following section in the web.config file to setup trace viewer
1. Add diagnostics section inside system.serviceModel
<diagnostics>
<messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" maxMessagesToLog="2147483647" maxSizeOfMessageToLog="2147483647" /></diagnostics>
<messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" maxMessagesToLog="2147483647" maxSizeOfMessageToLog="2147483647" /></diagnostics>
2. Add diagnostics section inside configuration
<system.diagnostics>
<sources>
<source name="System.ServiceModel.MessageLogging" switchValue="Information,ActivityTracing">
<listeners>
<add name="ServiceModelMessageLoggingListener">
<filter type=""/>
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="d:\Messages.svclog" type="System.Diagnostics.XmlWriterTraceListener" name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
<filter type=""/>
</add>
</sharedListeners>
<trace autoflush="true"/>
</system.diagnostics>
<sources>
<source name="System.ServiceModel.MessageLogging" switchValue="Information,ActivityTracing">
<listeners>
<add name="ServiceModelMessageLoggingListener">
<filter type=""/>
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="d:\Messages.svclog" type="System.Diagnostics.XmlWriterTraceListener" name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
<filter type=""/>
</add>
</sharedListeners>
<trace autoflush="true"/>
</system.diagnostics>
And that is it. It is ready. You don't need to do anything else. Run the service and can check the log.
Comments
Post a Comment