Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 93983 invoked from network); 25 Sep 2000 22:01:49 -0000 Received: from worf.imagelock.com (208.185.131.200) by locus.apache.org with SMTP; 25 Sep 2000 22:01:49 -0000 Received: from devajawa (ATHM-216-217-6-180.home.net [216.217.6.180] (may be forged)) by worf.imagelock.com (8.9.3+Sun/8.9.1) with SMTP id PAA14016 for ; Mon, 25 Sep 2000 15:01:48 -0700 (PDT) Message-ID: <010c01c0273c$33e2da80$6c01a8c0@office.imagelock.com> Reply-To: "Amandeep Jawa" From: "Amandeep Jawa" To: Subject: What is the best way to redirect System.out in my servlets running under Tomcat? Date: Mon, 25 Sep 2000 15:01:48 -0700 Organization: Imagelock, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Ok - so I know that there are partial answers to this question in the FAQ - but I'd like a definitive one (& hopefully a better one) & then I'll add it to the FAQ..... ALos most of the answers in the FAQ refer to JServ - not Tomcat...... What is the best way to redirect System.out in my servlets running under Tomcat? I'd like to get the std out messages into a log file. After searching the FAQ & the mailing list archive I tried numerous things - but the only one that worked was the invasive 2 step process of: 1) redirecting stdout from my tomcat launch script: $TOMCAT_HOME/bin/startup.sh >tomcat.log 2>tomcat.err 2) Early in my servlet source setting System.out to the same as System.err if(System.err != System.out) System.setOut(System.err); I REALLY don't like this method because a) I have to change code, b) it seems that now I've reconfigured the JVM & thus other java apps will have stderr = stdout & c) there is no really good place in my code to call System.setOut(System.err); Does anyone have a better solution? -------------------------- Amandeep Jawa Imagelock, Inc. -------------------------- deep@imagelock.com 1725 Montgomery St San Francisco CA 94111 Work: 415 616 7262 (616 SAMBA) Fax: 415 392 5382 http://www.imagelock.com