You can enable debugging in some libraries that internally make HTTP calls (in my case they are HTTPS, so checking through wirehark is not possible).
You should add to your app.config :
<system.diagnostics> <trace autoflush="true"/> <sources> <source name="System.Net" tracemode="protocolonly" maxdatasize="1024"> <listeners> <add name="TraceFile"/> </listeners> </source> </sources> <sharedListeners> <add name="TraceFile" type="System.Diagnostics.TextWriterTraceListener" initializeData="trace.log"/> </sharedListeners> <switches> <add name="System.Net" value="Verbose"/> </switches> </system.diagnostics>
This will add trace.log where your exe is running. If you do not know where your service works, you can specify a non-relative path.
In addition, it adds the same logs when running code inside Visual Studio in the output window (and not in the output console).
ps: You can change the log level to "Information" if you only need the request and response headers and information about opening and closing the connection (in my example, HTTPS).
morhook
source share