From users-return-219643-apmail-tomcat-users-archive=tomcat.apache.org@tomcat.apache.org Thu Dec 02 04:27:47 2010 Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 10817 invoked from network); 2 Dec 2010 04:27:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Dec 2010 04:27:46 -0000 Received: (qmail 29440 invoked by uid 500); 2 Dec 2010 04:27:43 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 29287 invoked by uid 500); 2 Dec 2010 04:27:43 -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 29278 invoked by uid 99); 2 Dec 2010 04:27:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Dec 2010 04:27:42 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of cerebrotecnologico@gmail.com designates 209.85.214.173 as permitted sender) Received: from [209.85.214.173] (HELO mail-iw0-f173.google.com) (209.85.214.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Dec 2010 04:27:35 +0000 Received: by iwn38 with SMTP id 38so1781388iwn.18 for ; Wed, 01 Dec 2010 20:27:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Rj06Osmwo/noRHZXdy2X/dn2KJVmVw/yhkZy2vSNOSM=; b=FbC9o7vUDdl2mnQTxdcu7sedw4KUhTvMHW4MvYZ9GZanXlxuHbkJG/KmB+vf1WTmlu 8t9CPJTlXqa2HKsYEjidTt77wcMDGvFLDyLOI33b92gn0ddHD+tE6oUQ7/XoWO1AN/LD w7d4VV45qKppgGX4lUg4qBpXtgqv3Thh/Lbwk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=e98Kv16lX+u2bKUbXBzE74svYS07wmtRfztqYn8mrj/4IcbaK6j6bHAHxX4xsjIPe/ 739a7MXluFj58jWyEHnTyyjc+OEGj8dtFIYhV03z4zRfBKwGHi5Z3WvrmGPyKSKFCIeQ PwMvG7VXwHgJ2zWlT/h6meL6TS+UN14HwaDec= MIME-Version: 1.0 Received: by 10.42.243.202 with SMTP id ln10mr2815147icb.216.1291264034215; Wed, 01 Dec 2010 20:27:14 -0800 (PST) Received: by 10.42.179.201 with HTTP; Wed, 1 Dec 2010 20:27:14 -0800 (PST) In-Reply-To: <33DCB864C66F46EB90795FA85BBB1AD5@phoenix> References: <18917.22681.qm@web56601.mail.re3.yahoo.com> <33DCB864C66F46EB90795FA85BBB1AD5@phoenix> Date: Wed, 1 Dec 2010 23:27:14 -0500 Message-ID: Subject: Re: Modifying logging levels logged in catalina.out at runtime From: Jorge Medina To: Tomcat Users List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org I do that by scheduling a thread that every minute checks if my logging.properties file has changed. You may use the timestamp of the file or a change of its MD5 hash to determine that the file has changed. If the file has changed, then I reconfigure the logging library (log4j) with the new contents of the file. I schedule the task when the webapp gets loaded/started and stop the task when the webapp is unloaded/stopped via the ContextListener. It is very handy to change log levels or even enable another appender on the fly. On Wed, Dec 1, 2010 at 6:32 PM, Jason Pyeron wrote: > > >> -----Original Message----- >> From: Mark Eggers [mailto:its_toasted@yahoo.com] >> Sent: Wednesday, December 01, 2010 15:20 >> To: Tomcat Users List >> Subject: Re: Modifying logging levels logged in catalina.out >> at runtime >> >> Hopefully you're not creating custom logging levels. Creating > > Nope, plain jane. > >> custom logging levels is the classic way to create >> classloader leaks. See the following as an >> example: >> >> http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java >> >> You can create a logging.properties file and place it in >> WEB-INF/classes. You can then change this file, rebuild your >> application, and redeploy it without taking down Tomcat. > > Good idea, whould still like to do it without taking down the webapp (tha= t was > the intention behind not restarting tomcat) > >> >> You could also add a WatchedResource element to your Context >> and point it at WEB-INF/classes/logging.properties. When that >> file is changed, Tomcat will reload the application. >> >> See: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html >> >> I'm not really sure you want to do the WatchedResource >> configuration in a production environment though . . . >> >> . . . . just my two cents. > > Our new applications are putting in a management console to adjust the lo= gging > setting, but legacy applications sometimes need to be debugged with out > restarting them. Think about leaks where the problem shows up only after = 3 > months of running. > >> ----- Original Message ---- >> From: Jason Pyeron >> To: Tomcat Users List >> Sent: Wed, December 1, 2010 11:59:28 AM >> Subject: Modifying logging levels logged in catalina.out at runtime >> >> This may be slightly off-topic. >> >> I'll start off with I know how to do this from inside the >> webapp's code and how to do it by modifing properties files >> on the system at tomcat startup. But how can it be done from >> outside the webapp with out restarting tomcat? >> >> We are using java.util.logging on tomcat 5.5.23 using jdk 1.6.0_17. > > > > -- > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - > - Jason Pyeron =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0PD Inc. http://= www.pdinc.us - > - Principal Consultant =A0 =A0 =A0 =A0 =A0 =A0 =A010 West 24th Street #10= 0 =A0 =A0- > - +1 (443) 269-1555 x333 =A0 =A0 =A0 =A0 =A0 =A0Baltimore, Maryland 21218= =A0 - > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- > This message is copyright PD Inc, subject to license 20080407P00. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org