In C #, I turned on tracing and the network trace source.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.diagnostics>
<sources>
<source name="System.Net" tracemode="includehex" maxdatasize="1024">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
</sources>
<switches>
<add name="System.Net" value="Verbose"/>
</switches>
<sharedListeners>
<add name="System.Net"
type="TraceTest.StringWriterTraceListener, TraceTest"
initializeData="myfile.log"
/>
</sharedListeners>
<trace autoflush="true" indentsize="4" />
</system.diagnostics>
</configuration>
But longer messages are truncated (long, like 12Kb / 30 lines, not for long, like 1GB!), So I get into a situation where only some of the most dangerous headers are logged.
How to fix it?
Or do you know a book or some resource that explains .Net tracing and debugging in great detail?
Log Example:
System.Net Information: 0 : [1204] Connection
{
Transfer-Encoding: chunked
Connection: keep-alive
Keep-Alive: timeout=10
Content-Type: text/html; charset=windows-1251
Date: Mon, 04 Jul 2016 17:50:33 GMT
Set-Cookie: uid=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0,uid=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/,uid=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; domain=.zamunda.net,pass=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0,pass=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/,pass=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; domain=.zamunda.net,bitbucketz=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0,bitbucketz=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/,bitbucketz=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; domain=.zamunda.net,cats=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0,cats=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/,cats=deleted;
expires=...}.
This is one message, the method Writeis somehow TraceListenercalled whit, which is one message as a parameter that is truncated ("...".) At the end)
Also, cookies are badly written and almost undetectable, but I can live with it ...
Yes, unfortunately, in addition to interfering with System.dll or using some odd and complex type inheritance, there is nothing to do.