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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: