How can I redirect the output of session.setDebug(true) so that I can capture it in the program that uses it?

John Zukowski

The messages are hardcoded to go to System.out. The best you can do is redirect System.out to a ByteArrayOutputStream:

ByteArrayOutputStream os = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(os);
// save output
PrintStream old = System.out;
// change output
// send
// reset output
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact