Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 40724 invoked from network); 21 Jan 2005 23:34:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 21 Jan 2005 23:34:52 -0000 Received: (qmail 23933 invoked by uid 500); 21 Jan 2005 23:34:36 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 23916 invoked by uid 500); 21 Jan 2005 23:34:36 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 23903 invoked by uid 99); 21 Jan 2005 23:34:36 -0000 X-ASF-Spam-Status: No, hits=0.3 required=10.0 tests=DATE_IN_PAST_24_48,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of placson@gmail.com designates 64.233.170.207 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (64.233.170.207) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 21 Jan 2005 15:34:34 -0800 Received: by rproxy.gmail.com with SMTP id 40so178523rnz for ; Fri, 21 Jan 2005 15:34:33 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=alMtyx8bnMWMMpPz/U3SckNjhwnpf96qwJ/tqfNH6XSTpUmBQIHvDBu/4PlSnyi3fjz/Bxu3l7+j+pFZQ47xQAfZOcRlqAQmN5JYg75cvpavbcXxzrlZWZI6/gFl3gyhqvssJOKPmNpQaS45dJ73s6PZXFfh5zKHcEBrOB8b3S4= Received: by 10.38.8.49 with SMTP id 49mr411296rnh; Fri, 21 Jan 2005 15:34:32 -0800 (PST) Received: from ?10.42.1.227? ([66.228.72.30]) by smtp.gmail.com with ESMTP id 72sm3561rna.2005.01.21.15.34.32; Fri, 21 Jan 2005 15:34:32 -0800 (PST) Message-ID: <41F03FEE.8040104@gmail.com> Date: Thu, 20 Jan 2005 18:34:06 -0500 From: Patrick Lacson User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomcat Users List Subject: Re: reload log4j.properties on-the-fly? References: <207fa8f050121100215234d6d@mail.gmail.com> In-Reply-To: <207fa8f050121100215234d6d@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Andy, Try the following to enable the log4j watchdog: public static void configure(final String configFile, final long delay, final Logger logger) { PropertyConfigurator.configureAndWatch(configFile,delay); FileWatchdog watcher = new FileWatchdog(configFile) { public void doOnChange() { new PropertyConfigurator().doConfigure( filename, LogManager.getLoggerRepository() ); if (logger != null) { logger.info("Re-read configuration file " + filename); } } }; watcher.setDelay(delay); watcher.start(); } Andy Kriger wrote: >I am running Tomcat 5.5 with log4j logging (log4j.properties in common/classes). > >Is it possible to make changes to the log4j properties and have the >changes reloaded on-the-fly instead of having to restart Tomcat in >order to pick up changes? This would be very useful for those times >debug level logging or specific class logging is needed where >generally that level of logging is not required. > >thx >andy > >--------------------------------------------------------------------- >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org