[jcifs] Redirect the JCIFS log to a log file
Del Merritt
del at alum.mit.edu
Thu Jun 3 04:47:01 MDT 2010
Mohan wrote:
> It is really very useful !!
>
> We have been facing intermittent SAN access failures and our
> admins. Refuse to install packet capture software. Hopefully I can debug
> this.
>
> What is the optimal level of log for a production system without
> overwhelming the system ?
I have not played a lot with this. If you Read The Fine Code you'll see
this is jcifs.util.LogStream:
0 - nothing
1 - critical [default]
2 - basic info can be logged under load
3 - almost everything
N - debugging
So the primary authors figure "2" is good. YMMV.
-Del
> Thanks,
> Mohan
>
> -----Original Message-----
> From: Del Merritt [mailto:del at alum.mit.edu]
> Sent: Wednesday, June 02, 2010 8:43 PM
> To: Mohan Radhakrishnan
> Cc: jcifs at lists.samba.org
> Subject: Re: [jcifs] Redirect the JCIFS log to a log file
>
> Mohan wrote:
>> Is there a way to redirect the JCIFS ( -Djcifs.util.loglevel=10 or
>> any other sufficient level ) to a log file ?
>
> If you are willing to write a smidge of code, then you can call:
>
> jcifs.util.LogStream.setInstance( ps );
>
> where "ps" is a PrintStream object; it defaults to System.err. You have
> to make the call before jCIFS cranks up.
>
> Note that as implemented, all logging will go to that PrintStream; you
> cannot currently filter it to different destinations. To make that
> happen, create your own class that extends PrintStream and you can
> override the write() method(s) as needed.
>
> -Del
>
More information about the jCIFS
mailing list