Return-Path: Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: (qmail 68786 invoked from network); 14 Dec 2004 22:18:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 14 Dec 2004 22:18:51 -0000 Received: (qmail 38995 invoked by uid 500); 14 Dec 2004 22:15:51 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 38940 invoked by uid 500); 14 Dec 2004 22:15:50 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 38855 invoked by uid 99); 14 Dec 2004 22:15:48 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from postman.medtronic.COM (HELO postman.medtronic.com) (144.15.157.121) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 14 Dec 2004 14:15:44 -0800 Received: from MSPM1BMSGH02.ent.core.medtronic.com (localhost [127.0.0.1]) by postman.medtronic.com (8.12.9/8.12.9) with ESMTP id iBEMFUA5010714 for ; Tue, 14 Dec 2004 16:15:30 -0600 (CST) Received: from MSPM1BMSGM16.ent.core.medtronic.com ([172.24.116.185]) by MSPM1BMSGH02.ent.core.medtronic.com with Microsoft SMTPSVC(6.0.3790.0); Tue, 14 Dec 2004 16:15:35 -0600 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Log File by java package and jsp package not working Date: Tue, 14 Dec 2004 16:15:31 -0600 Message-ID: <616816C3DDC4D74EB11AC96F6D469C1438FDE4@MSPM1BMSGM16.ent.core.medtronic.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Log File by java package and jsp package not working Thread-Index: AcTiKZv0JSKRt1TVRP6kvUCu7YYHPQAADNYw From: "Hanson, Bryan" To: "Log4J Users List" X-OriginalArrivalTime: 14 Dec 2004 22:15:35.0938 (UTC) FILETIME=[6F70BE20:01C4E22A] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N yes, but we are stuck with the folder structure we have, cannot change = it. Though we will be using BEA for awhile, no plans on changing it...so if = we can stick with a particular webserver, could we then (somehow) make = the logger able to determine servlet to log for? -----Original Message----- From: Jacob Kjome [mailto:hoju@visi.com] Sent: Tuesday, December 14, 2004 4:02 PM To: Log4J Users List Subject: RE: Log File by java package and jsp package not working Your loggers need not be named for their class. In fact, for JSP's you = can't count on any particular naming scheme for the generated class. I'm = pretty sure that is entirely implementation specific, so the class name generated = for "hello.jsp" maybe jsp_servlet_hello.java on Tomcat and = hello_jsp_servlet.java on Weblogic (I made these names up, but you get the point). If you = start counting on one naming scheme, you will quickly find yourself tied to a = server implementation. I suggest coming up with a standard naming scheme for your JSP's. For = instance, have them all be within some common base fake package and, maybe have = folder names further distinguish the package. Then, have the final name of the = logger itself be the name of the file (less ".jsp"). For instance, with the = base package "com.mycompany.jsp" and the following files... hello.jsp admin/manage.jsp admin/another.jsp help/howto.jsp The loggers might be, respectively, named... com.mycompany.jsp.Hello com.mycompany.jsp.admin.Manage com.mycompany.jsp.admin.Another com.mycompany.jsp.help.HowTo You'd do this by passing in these names rather than = this.getClass().getName() to the getLogger() method such as.... Logger logger =3D Logger.getLogger("com.mycompany.jsp.admin.Manage"); Your config, in order to display logger output for the "admin" package = only, would be... Make sense? Jake Quoting "Hanson, Bryan" : > > > I'm using log4J in a JSP with taglibs-log. I'm trying to configure = the > log4j.xml such that it will put the JSP log message in a particular = log file > based on the JSP/servlet package. So far, I have not been successful. > > Does anyone have ideas how to configure a log4j.xml to log JSP = messages to > package based log files? > > > > > > > > We have "capa" directory with JSP pages in it. The webserver compiles = the > jsp to jsp_servlet\_capa with the class package: package = jsp_servlet._capa > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org