views:

163

answers:

1

How to redirect javax.mail.Session setDebugOut to log4j logger?

Is it possible to redirect only mailSession debug out to logger?

I mean, there are solutions like

link text

which reassigns all standard output to go to log4j --System.setOut(new Log4jStream())

Best Regards

A: 

Write your own OutputStream class

and

mailSession.setDebugOut(new PrintStream(your custom aoutput stream object));

webgt