Last active
January 27, 2023 10:08
-
-
Save mrichman/9911daba9f7b4d799b4e21a7fbb5060f to your computer and use it in GitHub Desktop.
Enable WCF Service Trace Logging - view with SvcTraceViwer.exe (i.e. C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<!-- ... --> | |
<system.serviceModel> | |
<!-- ... --> | |
<diagnostics wmiProviderEnabled="true"> | |
<messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" maxMessagesToLog="3000" /> | |
</diagnostics> | |
</system.serviceModel> | |
<!-- ... --> | |
<system.diagnostics> | |
<sources> | |
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true"> | |
<listeners> | |
<add name="xml"/> | |
</listeners> | |
</source> | |
<source name="System.ServiceModel.MessageLogging"> | |
<listeners> | |
<add name="xml"/> | |
</listeners> | |
</source> | |
<source name="myUserTraceSource" switchValue="Information, ActivityTracing"> | |
<listeners> | |
<add name="xml"/> | |
</listeners> | |
</source> | |
</sources> | |
<sharedListeners> | |
<add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="C:\logs\Traces.svclog" /> | |
</sharedListeners> | |
</system.diagnostics> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you. The
<system.serviceModel><diagnostics><messageLogging>
element is inexplicably not mentioned by the official documentation, and it's a nasty gotcha.