Knowledgebase: Java
How to redirect debug logs to a file when using classes from Java Component APIs?
Posted by Daniel Demecillo II on 20 December 2011 04:14 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:
Help Desk Software by Kayako fusion