Return-Path: Delivered-To: apmail-logging-log4j-dev-archive@www.apache.org Received: (qmail 36226 invoked from network); 26 Oct 2007 01:45:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Oct 2007 01:45:01 -0000 Received: (qmail 2901 invoked by uid 500); 26 Oct 2007 01:44:49 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 2702 invoked by uid 500); 26 Oct 2007 01:44:48 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 2691 invoked by uid 99); 26 Oct 2007 01:44:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Oct 2007 18:44:48 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of will.sargent@gmail.com designates 209.85.146.182 as permitted sender) Received: from [209.85.146.182] (HELO wa-out-1112.google.com) (209.85.146.182) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Oct 2007 01:44:50 +0000 Received: by wa-out-1112.google.com with SMTP id v27so897970wah for ; Thu, 25 Oct 2007 18:44:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=Fthp1IzjADlSN7vBprfEd6/P4ZWYRXX1tQpPALsbnQE=; b=F9jMIu4FSfLXFZxa1avpD6HZ9QXAvQJ08BfdSgu4sBmFui5yNZAuqkKB6nvamX2rn3d4Umg2XQFVas1z4nLtOwbneVQYcFC4Ntfno0aFIF3xG1RXr1v6qgHIUTjzsYk2YT4R2/EEgQ3FsRlI+Rihz3h0OJ0jtVG4LKb3cyhRBAY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=kiUoGjcCWLZQIxRjoZf72hpTnJ9AyaFslCMPo911bZyZ/TfsdQeWxmw1ZwrJqtFFJksXZuQSPx84c/qkPWmdxwkVqI4bni5wTfKrfyTNpckYh/AoD2yWLqS4ZDeRSWnuYuAymAI+zLjBe5yzNeDvA/PmNPcR+A+9WRurfQsPFc8= Received: by 10.115.74.1 with SMTP id b1mr2811716wal.1193363042563; Thu, 25 Oct 2007 18:44:02 -0700 (PDT) Received: by 10.114.39.7 with HTTP; Thu, 25 Oct 2007 18:44:02 -0700 (PDT) Message-ID: Date: Thu, 25 Oct 2007 18:44:02 -0700 From: "Will Sargent" To: "Log4J Developers List" Subject: Re: Changing logging levels in Log4J dynamically? In-Reply-To: <472143B7.90403@ptc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <472143B7.90403@ptc.com> X-Virus-Checked: Checked by ClamAV on apache.org I've researched this in the past, and I did find a number of examples of people using JMX with log4j. So it's doable. http://blogs.averconsulting.com/2006/12/13/changing-log4j-logging-levels-dynamically.aspx http://www.devx.com/Java/Article/32359/1954?pf=true http://technology.amis.nl/blog/?p=1238 If the JMX code in 1.2.14 is not usable on its own, what does it do? Is it a starting point? Will. On 10/25/07, Jess Holle wrote: > Though I believe there have been recent fixes to it, I ended up giving > up on the JMX package in log4j and writing my own. > > You may be able to make it work well enough for your cases if you only > have a single LoggerRepository, though. If not, well last I saw it had > no notion or ability to cope with multiple repositories and I'd suggest > using the code as an sample code for writing your own at that point -- > taking what you like and leaving the rest :-) > > As for documentation, I'd suggest running with Java 5, adding the bit of > code to register the MBeans, connecting to your running app with > jconsole and playing around. You'll quickly see what's handled to your > liking and what's not this way. > > Besides JMX, there's always just calling setLevel() yourself -- as > triggered by an HTTP request, for example. You can also watch for > modifications to the log4j configuration file and reconfigure when it > changes -- not instantaneous, but still no restart required. > > -- > Jess Holle > > Will Sargent wrote: > > Hi all, > > > > I've heard several people ask if you can change log4j levels > > dynamically, once the application is already running. I see that > > there's a JMX package in 1.2.14, but there doesn't seem to be any > > javadoc or documentation attached to it. If there is, can someone > > point me to it? > > > > Will. > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org > > For additional commands, e-mail: log4j-dev-help@logging.apache.org > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org > For additional commands, e-mail: log4j-dev-help@logging.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-dev-help@logging.apache.org