Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 44157 invoked from network); 6 Jun 2007 13:42:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Jun 2007 13:42:52 -0000 Received: (qmail 36033 invoked by uid 500); 6 Jun 2007 13:42:39 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 36009 invoked by uid 500); 6 Jun 2007 13:42:39 -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 35998 invoked by uid 99); 6 Jun 2007 13:42:39 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jun 2007 06:42:39 -0700 X-ASF-Spam-Status: No, hits=0.8 required=10.0 tests=INFO_TLD,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of rc46fi@googlemail.com designates 209.85.146.176 as permitted sender) Received: from [209.85.146.176] (HELO wa-out-1112.google.com) (209.85.146.176) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jun 2007 06:42:35 -0700 Received: by wa-out-1112.google.com with SMTP id m38so181111waf for ; Wed, 06 Jun 2007 06:42:15 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=sLwoKniQ1sVd61gtOiHqWtFQUssxgvxmF1Gw/H7i6wP3f3dPYmH/w2qqjMKcd+lSJ6PaeBy1/qVicT/DOPCUyKk6hOH7eEQml/NIdpog9ixdCaabZqkJtdw9AWArKhgTNAJo9wR5PQ93KUBtctWqxVGyFJJ6Aa+6Y1djbvKMjwQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=acLaBig3tuJEv4M60yCGXpRlTZj9UrXEfhgD66ys9Bi0Pa2GAWLBicKAa3y9LvvZBfLv5GCJ9z4Sgg4O5/X3HXnwdFotKKaJKx55jQL/nG6LqpesXEsPkt3RGZqiYiz0Jyf5U1rSaJMwLo827+Dvm46kvVuQXsTs1Lqsy8p3jFs= Received: by 10.115.95.1 with SMTP id x1mr434533wal.1181137334562; Wed, 06 Jun 2007 06:42:14 -0700 (PDT) Received: by 10.141.212.1 with HTTP; Wed, 6 Jun 2007 06:42:14 -0700 (PDT) Message-ID: Date: Wed, 6 Jun 2007 15:42:14 +0200 From: "Gregor Schneider" To: "Tomcat Users List" Subject: Getting nuts with Tomcat 5.5 and log4j 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 Hi guys, I've setup Tomcat on my Debian Box so that all loging goes to $CATALINA_HOME/logs/tomcat.log I've placed the files log4j.(xml,dtd) int $CATALINA_HOME/common/classes, and it runs like charm. Now, I've added another logger which is supposed to log the output of our apps only. That logger should be in place as a default logger for all web-apps. The benefit is, that no web-app has to provide it's own log4j.xml. This is a snipped of the log4j.xml from $CATALINA_HOME/common/classes where - the root-logger logs everything coming from Tomcat Engine - CompassLogger logs everything coming from our applications: ... ... ... ... ... ... ... Well, this runs like charm. However, now I'm gaving another web-app which is supposed to have it's own log-file and should not use CompassLogger but create it's own logger. I've created the following file log4j.xml 8again a snippet since it's quite some code) and put it into $CATALINA_HOME/webapps/MyWebApp/WEB-INF/classes (together with log4j.dtd): ... ... ... Within my Servlet, I'm having the following peace of code to initialize the logger: public void init(ServletConfig aConfig) throws ServletException { super.init(aConfig); DOMConfigurator.configure("log4j.xml"); ssoLogger = Logger.getLogger("SSOLogger"); However, when the servlet is started, I'm getting the following Exception in catalina.out *sic*: log4j:ERROR Could not parse file [log4j.xml]. java.io.FileNotFoundException: /home/tomcat/packages/apache-tomcat-5.5.20/logs/log4j.xml (No such file or directory) I've read the log4j-docs, read all the Tomcat-docs about Tomcat & log4j (which are not too helpful, I'm afraid), browsed through the "complete log4j-manual - the one you'll have to buy), but nothing could answer my questions: 1. Is it possible create a default logger with a log4j.xml-configuration in $CATALINA_HOME/common/classes PLUS create some application-specific loggers with a log4j.xml-configuration in $CATALINA_HOME/webapps/MyWebApp/WEB-INF/classes? 2. If so, is it correct that I have need to define the root-logger only in my default-logger-config (common/classes)? 3. Why is everybody writing that I have to drop my log4j.xml into $CATALINA_HOME/webapps/MyWebApp/WEB-INF-classes, however, log4j is searching for a file $CATALINA_HOME/ogs/log4j.xml ? I know it's quite some log4j-stuff, and this is a Tomcat-mailinglist, however, I guess this is a real-life-example referring to Tomcat AND log4j, so hopefully somebody here can shed some light. Any suggestions welcome! Gregor -- what's puzzlin' you, is the nature of my game gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2 gpgp-key available @ http://pgpkeys.pca.dfn.de:11371 --------------------------------------------------------------------- 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