com.sun.* package use PrintStream for logging. For example class com.sun.mail.smtp.SMTPTransport
private PrintStream out;
...
if (debug)
out.println("DEBUG SMTP: useEhlo " + useEhlo + ", useAuth " + useAuth);
is this possible to log these events with log4j? One solution, is to create proxy for System output, like here is suggested: log4j redirect stdout to DailyRollingFileAppender, but problem is, there would be logged all events which use PrintStream, not only com.sun.mail.* package, and I can't only log from com.sun.* package.
For example I want to log email events into separate file, but can't, because of probability of some other class from some 3rd party library using PrintStream.