Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 33746 invoked from network); 21 Dec 2005 19:30:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Dec 2005 19:30:05 -0000 Received: (qmail 94167 invoked by uid 500); 21 Dec 2005 19:29:49 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 94152 invoked by uid 500); 21 Dec 2005 19:29:48 -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 94141 invoked by uid 99); 21 Dec 2005 19:29:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Dec 2005 11:29:48 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [62.240.241.26] (HELO mail1.bat1.fr.arkeia.com) (62.240.241.26) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Dec 2005 11:29:48 -0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail1.bat1.fr.arkeia.com (Postfix) with ESMTP id D7129C228 for ; Wed, 21 Dec 2005 20:29:26 +0100 (CET) Received: from mail1.bat1.fr.arkeia.com ([127.0.0.1]) by localhost (mail1 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 19301-09 for ; Wed, 21 Dec 2005 20:29:26 +0100 (CET) Received: from [10.1.13.75] (unknown [10.1.13.75]) by mail1.bat1.fr.arkeia.com (Postfix) with ESMTP id 2ECB6BF74 for ; Wed, 21 Dec 2005 20:29:26 +0100 (CET) Message-ID: <43A9AC7E.6000707@arkeia.com> Date: Wed, 21 Dec 2005 20:26:54 +0100 From: Philippe LEGAY Reply-To: plegay@arkeia.com User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.12) Gecko/20050915 X-Accept-Language: en-us, en MIME-Version: 1.0 To: users@tomcat.apache.org Subject: log4j - Class.forname - black magie Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by Amavisd-New/CLAMAV at mail.bat1.fr.arkeia.com X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello I succeed by black magie to have log via log4j under tomcat 5.5.9. So when a call my servlet, I have some trace into a file (/tmp/phl.log). I said black magie, because I had a lot of problems to put the log4.jar in the right place. Now, I have just installed the tomcat 5.5.12, reinstalled by web application and of course the same log4j.properties file. But no more trace. So As I have no change the lo4j.properties, I think it is a tomcat problem. Tests : On another computer : installation of tomcat 5.5.12 (+ compat for JRE 1.4) + modify HelloWorld example code to have trace with log4j. Call the servlet => Get exception : Class logger (from log4j) is not found. OK Add in apache_tomcat.5.5.12/shared/lib the log4j.jar, call the servlet, get the HTML page and the trace into a file. OK Go back on the first computer : suppress all log4j.jar into the Tomcat Environment (..../apache-tomcat-5.5.12). Call the servlet => Get the HTML content, No trace, and of course no exception ! Why ? Where does tomcat find the log4j.jar ? Just for fun, I add in my servlet code : try { l = Class.forName("Logger") ; } catch (java.lang.ClassNotFoundException ex) { reshtml.putString("

EX Class not Found

") ; } Call the servlet => Get the HTML content + EX Class not Found + No trace, and of course no exception. If I replace Logger by a tool class (that I use to generated the HTML code), the same exception message, but I see the HTML code, so I see the result of the tool class that produces this HTML code. Questions : - It seems that Class.forName does not work in tomcat. Why ? bad definition ot the PATH ? - How to set the PATH for Class.forName ? - Where is the log4j.jar ? Or Why does I have no exception ? Is there some cache into the TOMCAT server ? - Is it possible to load by hand log4j (with Class.forName or other mechanism) and then get (How ? ) the path used to get this library ? - And the main question : How must I configure the tomcat server to have log4j trace into my servlet code ? Which version of log4j (5.2.11, or more ) ? Whee must I put the log4j.jar : tomcat.5.5.12/share/lib ? Thanks PHL. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org