I'm writing an application where I use
in all my source code.
I'm now using JSch 0.1.44 for SSH functionality, and find that beyond a
certain point in my program, the output from Logger.log(Level,String) no
longer is shown.
I've reproduced this problem in the example program
provided with JSch.
I added calls to
and see that somewhere between
all output from java.util.logging.Logger.log disappears.
I've logged this problem as a bug; you can find the code of
Exec.java with log statements added, there as attachment.
If I dig a little deeper, and add Logger.log statements to
relevant parts of
I see that after IO.out_ext.close() no more log messages
Does anybody know how to fix this?
The cause of the problem is in Exec.java :
The solution is simple:
boolean dontClose = true;
((ChannelExec) channel).setErrStream(System.err, dontClose);
The reason that this is needed, is that without dontClose true, in
the output stream passed to setErrStream() will be closed .
(The session stores this output stream in
where io is a private instance variable of Session:
private IO io;
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.