tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lyallex <>
Subject logging mail session debug
Date Tue, 24 Jul 2007 07:54:20 GMT
Good Morning

tomcat 5.5.23
java 1.5.0_10
javamail 1.4ea

I have two classes

foo.MailQueueWatcher extends TimerTask

I have the following logging config in ${catalina.home}/conf/

... = FINE = ${catalina.base}/logs = mailer

I don't really understand the Tomcat/juli documentation but this works
by trial and error and writes all logging output
from the MailQueueWatcher to ${catalina.base}/logs/mailer...log as expected.

I have configured the logger in MailServer to write to the watcher log

class MailServer {
   Logger logger = Logger.getLogger("foo.MailQueueWatcher");

   //the following code in this class writes to
${catalina.base}/logs/mailer...log (same as above)

   logger.log(Level.WARNING, this.getClass().getName() + "Logging output");

   //I have the following code in my sendMail method
   Session session = Session.getInstance(properties);

what I am trying to do is send the session debug output to the watcher log
at the moment it goes to System.out. I have tried all sorts of things
with streams but what I really
want to do is stream this data as it is made available into the log file.
I suppose I was was hoping to be able to do something like this
session.setDebugOut(new PrintStream(...get some stream into the logger, true));

I'm sure there is a simple answer to this (or maybe not) but I just
can't see it...

any help/pointers to documentation/archived postings etc much appreciated.


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message