Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 55319 invoked from network); 23 Aug 2000 18:06:19 -0000 Received: from karen3.immaculate.org (HELO edamame.stinky.com) (209.60.53.27) by locus.apache.org with SMTP; 23 Aug 2000 18:06:19 -0000 Received: (qmail 2066 invoked by uid 510); 23 Aug 2000 10:57:35 -0000 Date: Wed, 23 Aug 2000 03:57:35 -0700 From: Alex Chaffee To: Gulcu Ceki Cc: alex@jguru.com, tomcat-dev@jakarta.apache.org Subject: Re: Tomcat Logging Message-ID: <20000823035735.A2037@edamame.stinky.com> Reply-To: alex@jguru.com References: <20000822040645.A14705@edamame.stinky.com> <0008231024.AA25396@falknis.zurich.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <0008231024.AA25396@falknis.zurich.ibm.com>; from cgu@zurich.ibm.com on Wed, Aug 23, 2000 at 12:24:05PM +0200 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Ceki - Thanks for the thorough reply. Yes, it's important to keep the ability to maintain multiple log files. One target architecture for Tomcat is an ISP hosting hundreds of different webapps for different clients; with multiple log files (one per webapp) the admin can maintain security (so people can't read each other's logs). I'm wary of the NDC approach; as you said, since Tomcat uses thread pooling, it would require activity before and after each request. This would surely have some impact on performance (especially if it requires allocating new objects -- a main part of the performance tuning Costin's doing is minimizing GC). The per-context or per-component category idea seems more sound. Again, it would only solve the output side of things (#3 on my original list); we'd still have to write Tomcat code to handle 1. configuration (though I can imagine with a bit of cleverness we could delegate most or all of the log config out of server.xml and into log4j's config file) 2. standardizing the way a component knows which category/target to write to. This could be as simple as a string property (instance variable) with log4j category, or maybe an interface, something like interface LogAware { void setLogTarget(String category); } or, better: interface LogAware { void setLogger(Logger l); } interface Logger { void setCategory(String category); // for writing directly to a log4j category void setMaster(Logger logger); // for delegating to a parent void log(String msg); // etc. } and then appropriate helper and impl classes, and implementing it in all components.) 3. regulating "debug" level (so a component won't even execute the code that builds the debug log strings -- which may involve some heavy lifting -- this simply can't be handled by library code in Java) and probably some more things I've forgotten :-) - Alex P.S. This is fun! It's really helping me flesh out my understanding of the issues. Hopefully, even if we don't use log4j with Tomcat, we can each help the other's product get stronger... -- Alex Chaffee mailto:alex@jguru.com jGuru - Java News and FAQs http://www.jguru.com/alex/ Creator of Gamelan http://www.gamelan.com/ Founder of Purple Technology http://www.purpletech.com/ Curator of Stinky Art Collective http://www.stinky.com/