Is there a neat way to do contextual logging in a concurrent system?

Is there a way to skip logging hex form from System.Net?

  • I've enabled System.Net logging in application configuration and problem is, that xml messages in log file look like this: System.Net Verbose: 0 : [7148] 00000000 : 3C 73 3A 45 6E 76 65 6C-6F 70 65 20 78 6D 6C 6E : <s:Envelope xmln System.Net Verbose: 0 : [7148] 00000010 : 73 3A 73 3D 22 68 74 74-70 3A 2F 2F 73 63 68 65 : s:s="http://sche which makes it very hard to read (as long as I don't need hex representation, and textual representation is several symbols wide). Is there a way to tell .net to skip hex part?

  • Answer:

    Set the tracemode to protocolonly as explained in the http://msdn.microsoft.com/en-us/library/ty48b824.aspx: <source name="System.Net" tracemode="protocolonly" maxdatasize="2048"> <listeners> <add name="MyLog" /> </listeners> </source>

Giedrius at Stack Overflow Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.