How to redirect debug logs to a file when using classes from Java Component APIs?
Posted by Daniel Demecillo II, Last modified by Van Glass on 18 January 2012 12:25 PM

Most client component class (Ftp, Ftps, Sftp, Scp, Http, etc.) within the various Java Component APIs write debug logs into the console by default when debug is enabled. If you want them to write to a file instead, you can do so by calling the setDebugStream method passing a PrintStream instance as parameter. Below is a code snippet showing how this is accomplished for Sftp

PrintStream debugStream = new PrintStream(new FileOutputStream("sftp.log"));

(3 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below. This is required to prevent automated registrations and form submissions.

Help Desk Software by Kayako