Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 55631 invoked from network); 30 Jul 2002 14:12:18 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 30 Jul 2002 14:12:18 -0000 Received: (qmail 25588 invoked by uid 97); 30 Jul 2002 14:12:32 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 25539 invoked by uid 97); 30 Jul 2002 14:12:30 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 25526 invoked by uid 98); 30 Jul 2002 14:12:30 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Subject: Re: [5.0] mbean-names [logging] From: Bob Herrmann To: Tomcat Developers List In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 30 Jul 2002 10:16:07 -0400 Message-Id: <1028038567.9108.15.camel@dhcp-70-230> Mime-Version: 1.0 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Mon, 2002-07-29 at 23:04, costinm@covalent.net wrote: > On 29 Jul 2002, Bob Herrmann wrote: > > > > > > Same should happen for Log, assuming we get the commons-logging > > > to support JMX and add a wrapper for JDK1.4 ( for log4j > > > we should just use their mbean ). I assume we all agree on > > > moving to commons-logging as API, and keeping the old Logging > > > interface only for backward compat. > > > > I just reviewed the tomcat 5.0 proposal, and I didn't notice anything > > about logging changing in 5.0 > > > > Just so I understand this, the current use of element > > "will/should/encouraged to" disappear in 5.0 and instead modules will > > directly call the commons-logging interface? So if I want to log a > > particular context/webapp or Host or Engine, I will have to figure out > > what "domain" it logged to and get the underlying logging system (log4j, > > JDK1.4, logkit) to filter out the webapp/Host/Engine I am interested in? > > This has been discussed separately, and AFAIK nobody objected to the > idea of using commons-logging in 5.0. It was proposed and accepted > officially for jk and coyote, and even if no formal vote was made > for 5.0 and jasper2 I assume it'll get a majority. > > The element and interfaces will not disapear - it'll remain > for backward compat, just like the realm stuff. I assume the attributes > will be passed to the commons-logging impl. Just so I get an idea of the scale of changes.. Tomcat has a lot of code that uses a pattern like this; private void log(String message) { Logger logger = null; if (container != null) logger = container.getLogger(); if (logger != null) { logger.log(getName() + "[" + container.getName() + "]: " + message); } else { String containerName = null; if (container != null) containerName = container.getName(); System.out.println(getName() + "[" + containerName + "]: " + message); } } Would the 5.0 logging look more like this ?? ( I am just changing the System.out calls to instead defer to a commons-logging logger. ) private void log(String message) { Logger logger = null; if (container != null) logger = container.getLogger(); if (logger != null) { logger.log(getName() + "[" + container.getName() + "]: " + message); } else { String containerName = null; if (container != null) containerName = container.getName(); //import org.apache.commons.logging.Log; //import org.apache.commons.logging.LogFactory; Log log = LogFactory.getLog( containerName ); log.info( getName() + "[" + containerName + "]: " + message); } } (Note that commons-logging is going to record the log method (and not the caller's) method in the logging output) > > My understanding is that we'll gradually start using commons-logging > inside tomcat/jasper. So all components will use commons-logging, > and we'll have a mechanism to configure it per/webapplication ( or > host, engine ). Ceki already has some support in log4j to support > this, and we can try to do something similar in the jdk1.4 wrapper. > > The details for configuration are not yet clear - it depends a lot > on the overal scheme and I assume on what we do for users, since the > problem is very similar. ok. > > I like Craig's proposal for separate Users - and the Log can work the > same. If you have ideas/sugestions about how to manage the loggers - > please post them. 5.0 is still at an early stage, but those things > should be discussed sooner rather than later. > > Of course, that's my understanding - I may be wrong. > > > Costin -- To unsubscribe, e-mail: For additional commands, e-mail: