Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 33630 invoked from network); 24 Jul 2007 07:54:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Jul 2007 07:54:56 -0000 Received: (qmail 96524 invoked by uid 500); 24 Jul 2007 07:54:44 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 96208 invoked by uid 500); 24 Jul 2007 07:54:43 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 96197 invoked by uid 99); 24 Jul 2007 07:54:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jul 2007 00:54:43 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lyallex@gmail.com designates 209.85.132.245 as permitted sender) Received: from [209.85.132.245] (HELO an-out-0708.google.com) (209.85.132.245) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jul 2007 00:54:41 -0700 Received: by an-out-0708.google.com with SMTP id b2so452777ana for ; Tue, 24 Jul 2007 00:54:20 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=g0M1cyEvOvB/2RF0WCdnrUwQV8nJdXI2nVAbOEQArXBXTYsoKSqyctRfVzCMG9oJSEmkZHZQJb6qMh+8OE02CMoQvqjaX4hXmVkJqAvNmkfa7j7QZyrEDQCyny75loGMDyVi2Jvz92VJ9w+orVRqOG6JaO662V4RvGRlFZYbEj0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=UUlCTuUGENdpo+ePl8rFYOfMWWc2h9EU12IVYJKowiwQ6i1dpMlaGI34VAeZNdJ3v/vH60ZHvNimrrxYPsXRya4rakRzVCGRP7JMawxj4ZNiJGr0j6vFCaE9JQcfAOMvubzjOG5SYYsv8g5Lo1jpko16PtRnkOvXG5d4Wwbga3k= Received: by 10.100.153.17 with SMTP id a17mr2149865ane.1185263660259; Tue, 24 Jul 2007 00:54:20 -0700 (PDT) Received: by 10.100.44.4 with HTTP; Tue, 24 Jul 2007 00:54:20 -0700 (PDT) Message-ID: <28174dd80707240054l3871c74dm27900ec2cff41319@mail.gmail.com> Date: Tue, 24 Jul 2007 08:54:20 +0100 From: Lyallex To: "Tomcat Users List" Subject: logging mail session debug MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org Good Morning tomcat 5.5.23 java 1.5.0_10 javamail 1.4ea jaf-1.1 I have two classes foo.MailQueueWatcher extends TimerTask foo.MailServer I have the following logging config in ${catalina.home}/conf/logging.properties foo.MailQueueWatcher.level=ALL foo.MailQueueWatcher.handlers=2myapp.org.apache.juli.FileHandler ... 2myapp.org.apache.juli.FileHandler.level = FINE 2myapp.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 2myapp.org.apache.juli.FileHandler.prefix = 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); session.setDebug(true); ... } 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. Rgds Duncan --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org