JSSE Debug Logging With Timestamp
These days, I was asked about a strange network delay of input/output stream when migrating a TLS protected application to a new platform. The application is built on top of SunJSSE. They enabled debug with option "-Djavax.net.debug=all", however, because there is no timestamp in the debug output, the debug logging was not of much help. Is there any way to enable JSSE debug logging with timestamp? Definitely, the answer is YES. It is straightforward. Firstly, create a class extends PrintStream,and override all println() methods. I used a static nested class here. final static class TimestampPrintStream extends PrintStream { TimestampPrintStream(PrintStream out) { super(out); } public void println() { timestamp(); super.println(); } public void println(boolean x) { timestamp(); super.println(x); } public void println(char x) { timestamp(); super.println(x); } public void printl...