Debug logs

We have a Windows SAN drive that is used to store files. The JCIFS library that is
used to access this drive sometimes timed out. We wanted to look at the packets before
increasing the socket timeout.Packet capturing software which
would have shown these access failures were barred from our production systems.
So we had a nagging debugging problem.

We set -Djcifs.util.loglevel=10 but this information is copious and was difficult to
analyze when printed in the DOS console.

We could not understand how to gather low-level debugging information in a log file.
I asked the forums and found that this code

PrintStream ps = new PrintStream( new File( "C:\\jcifslog" ));

jcifs.util.LogStream.setInstance( ps );

can actually redirect the log based on the “jcifs.util.loglevel” setting to a log file.
Now we have ample packet information to understand where the problem is.

We have realized that sufficient logs are indispensable even in production environments and
we make quite an effort to gather and print logs. Sometimes even though the logs are GigaBytes
in size we enable them as they are very helpful.