Not Logging Msmq Messages

I have this configuration in <system.diagnostics> section

<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Verbose, ActivityTracing" propagateActivity="true">
<listeners>
<add name="messages" type="System.Diagnostics.XmlWriterTraceListener" initializeData="logs\tracelog.e2e"/>
</listeners>
</source>

<source name="System.ServiceModel.MessageLogging" switchValue="Verbose, ActivityTracing">
<listeners>
<add name="messages" type="System.Diagnostics.XmlWriterTraceListener" initializeData="logs\messages.e2e"/>
</listeners>
</source>
<source name="System.IO.Log" switchValue="All">
<listeners>
<add name="sdt" type="System.Diagnostics.XmlWriterTraceListener" initializeData="logs\SdrConfigExample.e2e"/>
</listeners>
</source>
</sources>
</system.diagnostics>

and this in the <system.servicemodel> section

<diagnostics>
<messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" maxMessagesToLog="3000"/>
</diagnostics>

I am consuming a service using MsmqIntegrationBindig. Why the messages I send are not logged in the log file Am I missing some configuration

Thanks in advance




Answer this question

Not Logging Msmq Messages

  • cunnus88

    Hello,

    The WCF logging infrastructure assumes that the messages are SOAP messages on the wire and are encoded with the help of WCF encoders. The MsmqIntegration transport is special in the sense that it doesn't use SOAP on the wire. It was designed specifically to interop with the non-WCF MSMQ applications and supports many custom message encoding facilities available only in System.Messaging (or other MSMQ APIs). Because of this, the WCF logging components can't decode and therefore log the message correctly.

    To get a full, first-class experience with WCF over MSMQ one might use net.msmq binding instead. Among other features this will also turn on the message logging feature.

    thanks, - leszek


  • dilsiam

    Do you use the configuration editor (SvcConfigEditor.exe)


  • demerzel

    The initial config file was generated using the SvcConfigEditor.exe, in particular I used the Diagnostics tab.Since then I already changed the config file with a Trial-And-Error approach to get the Msmq messages logging, but without success until now.



  • Not Logging Msmq Messages