I\'ve used Jakarta commons HttpClient in another project and I would like the same wire logging output but using the \"standard\" HttpUrlConnection.
I\'ve used Fiddl
What about using AspectJ to insert a Pointcut to add logging advice around a method? I believe AspectJ can weave it's way into private/protected methods.
It appears that sun.net.www.protocol.http.HttpURLConnection.writeRequest may call sun.net.www.http.HttpClient.writeRequest which takes the MessageHeader Object as an input so that would be your target.
In the end this might work but will be awfully fragile and only work on the Sun JVM; and really you could only trust the exact version you are using.