-1

We are using system.diagnostics in our IIS configuration to debug a SOAP failure. Our SOAP packets are a reasonable size so we get:

System.Net Verbose: 0 : [8392] (printing 1024 out of 2238)

Our configuration is:

  <system.diagnostics>
    <trace autoflush="true" />
    <sharedListeners>
      <add name="file" initializeData="c:\network.log" type="System.Diagnostics.TextWriterTraceListener" />
    </sharedListeners>
    <sources>
      <source name="System.Net" switchValue="Verbose">
        <listeners>
          <add name="file" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>

Is there a way of increasing the printing such that we can get the whole XML packet (i.e. all of the 2238 bytes)?

--- Update: From the comments, updated section:

  <system.diagnostics>
    <trace autoflush="true" />
    <sharedListeners>
      <add name="file" initializeData="c:\network.log" type="System.Diagnostics.TextWriterTraceListener" />
    </sharedListeners>
    <sources>
      <source name="System.Net" tracemode="includehex" maxdatasize="4096">
        <listeners>
          <add name="System.Net"/>
        </listeners>
      </source>
      <source name="System.Net" switchValue="Verbose">
        <listeners>
          <add name="file" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>
</configuration>

This has no effect on the output of the log.

user626201
  • 1,623
  • 3
  • 19
  • 36
  • 1
    The tutorial covers it all https://learn.microsoft.com/en-us/dotnet/framework/network-programming/how-to-configure-network-tracing – Lex Li Oct 07 '19 at 19:37
  • you could refer this [link](https://learn.microsoft.com/en-us/dotnet/framework/wcf/diagnostics/configuring-message-logging) try to set this code in web.cong file: ` ` and ` ` – Jalpa Panchal Oct 08 '19 at 06:32

1 Answers1

0

So it turns out we got our names wrong in the above comment. The working configuration:

<system.diagnostics>  
  <sources>  
    <source name="System.Net" tracemode="includehex" maxdatasize="4096">  
      <listeners>  
        <add name="System.Net"/>  
      </listeners>  
    </source>   
  </sources>  
  <switches>  
    <add name="System.Net" value="Verbose"/>  
  </switches>  
  <sharedListeners>  
    <add name="System.Net"  
      type="System.Diagnostics.TextWriterTraceListener"  
      initializeData="c:\network.log"  
    />  
  </sharedListeners>  
  <trace autoflush="true"/>  
</system.diagnostics>

@LexLi - thanks for the link.

user626201
  • 1,623
  • 3
  • 19
  • 36