Hi Ravi,

1) Create your own Logger class that implements com.jcraft.jsch.Logger and uses 
log4j
2) Apply your Logger using 
com.jcraft.jsch.JSch.setLogger(com.jcraft.jsch.Logger) method
Check Logger class of JSch example for reference.

Hope this helps.

Regards,
Viet




________________________________
 From: Ravi Joshi <ravi.josh...@yahoo.com>
To: "jsch-users@lists.sourceforge.net" <jsch-users@lists.sourceforge.net> 
Sent: Sunday, 29 December 2013 4:47 PM
Subject: [JSch-users] How to set ChannelExec error stream from System.err to    
log4j
 


Hi,

I want to execute a command to remote linux machine. I am referring Exec.java 
(http://www.jcraft.com/jsch/examples/Exec.java.html) example code.

I just wanted to know How to set ChannelExec error stream from System.err to 
log4j, so that all of these errors, I can get captured by log4j under error 
catagory.


-
Thanks
Ravi

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to