I am having a WCF service secured by X509, a client and they are working as expected.
I am trying to log the message at serverside and view the decrypted messages. But what I am getting in the log is encrypted message.
I have set logMessagesAtServiceLevel=”true”. Please help me find the issue with my configuration.
Following is the configuration:
<system.serviceModel>
.. service definition here...
<diagnostics>
<messageLogging
logEntireMessage="true"
logMalformedMessages="false"
logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="false"
maxMessagesToLog="3000"
maxSizeOfMessageToLog="2000"/>
</diagnostics>
</system.serviceModel>
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Verbose, ActivityTracing"
propagateActivity="true" >
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging"
switchValue="Verbose">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="Microsoft.IdentityModel"
switchValue="Verbose">
<listeners>
<add name="xml" />
</listeners>
</source>
</sources>
<sharedListeners>
<add name="xml"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="c:\log\Traces.svclog" />
</sharedListeners >
<trace autoflush="true" />
</system.diagnostics>
</configuration>
Just for completion,
the same configuration given in my question worked. But, I had to increase the maxsizeofmessagetolog like
maxSizeOfMessageToLog=”200000″