Return-Path: Delivered-To: apmail-incubator-jspwiki-dev-archive@minotaur.apache.org Received: (qmail 90638 invoked from network); 7 Sep 2009 11:55:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Sep 2009 11:55:47 -0000 Received: (qmail 95991 invoked by uid 500); 7 Sep 2009 11:55:47 -0000 Delivered-To: apmail-incubator-jspwiki-dev-archive@incubator.apache.org Received: (qmail 95977 invoked by uid 500); 7 Sep 2009 11:55:47 -0000 Mailing-List: contact jspwiki-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jspwiki-dev@incubator.apache.org Delivered-To: mailing list jspwiki-dev@incubator.apache.org Received: (qmail 95967 invoked by uid 99); 7 Sep 2009 11:55:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Sep 2009 11:55:47 +0000 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 andrew.r.jaquith@gmail.com designates 74.125.92.145 as permitted sender) Received: from [74.125.92.145] (HELO qw-out-1920.google.com) (74.125.92.145) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Sep 2009 11:55:37 +0000 Received: by qw-out-1920.google.com with SMTP id 5so630259qwf.54 for ; Mon, 07 Sep 2009 04:55:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=bdSOPIQvphxaSLcX7Mk/B0rGAht7SLe5oPk00juh9P0=; b=IXtm+yivRvffCSfLPy7tRFy6SNBRVYpRQ01Jfavgx/A1k40+sKljfd41yQ186BHKFq sIVeD6M0UTDNwjZ5kHCdiK0FcXml+eBMdTt+18nuQ+014M1bJWQmZdI2pwFYuBdzxyPp ym41XL4YoKFOb3N7Om5UmCShYpuM1MI/o9jlY= 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=bA0VG2uwlpaTYixzbSrg0yiFJ3rdjbbvvtz40l8Q84bDENyO3mV8Jr70u6ZL2ybWs5 vtJFZachp4y7NKa6QGsfKR2pUaJRwy1BMDRlT5tiDJYOppweiOmwui0oj8wwmi6x8H57 pxosoHrFoLsdBUJ64ykj4dyIWxwvXQYBrsX/A= MIME-Version: 1.0 Received: by 10.224.85.133 with SMTP id o5mr9026512qal.387.1252324515129; Mon, 07 Sep 2009 04:55:15 -0700 (PDT) In-Reply-To: References: <3a6c97f00909060945o2864cf4fu59af20916475114d@mail.gmail.com> <9FA0E913-49E8-40EA-A8C3-827E0A825BC2@ecyrd.com> Date: Mon, 7 Sep 2009 07:55:15 -0400 Message-ID: Subject: Re: Restart logging? From: Andrew Jaquith To: jspwiki-dev@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Ok, I figured it out. Google is my friend. I simply added this to the [new] WikiEngine.restart() method: LogManager.resetConfiguration(); ClassLoader cl =3D this.getClass().getClassLoader(); URL log4jprops =3D cl.getResource( "log4j.properties" ); if (log4jprops !=3D null) PropertyConfigurator.configure(log4jprops); ...and that's all it took. I'll check this in soon. Hat-tip goes to Alan Green at bright-green.com. :) Now, this might not work if somebody swaps out their logging configuration, so we might want to add in some safeguards to see if Log4j is actually being used. But to Janne's point, this is about the first-use experience. Which has now improved dramatically. :) Andrew On Mon, Sep 7, 2009 at 5:43 AM, Dalen, Andre van wrote: > >> Another possibility is to switch to Simple logging, which always goes > >> to stdout - in Tomcat's case, catalina.out. =A0Then there would be no >> need to provide configuration on Install.jsp, which would simplify our > >> install process even more. > > Such simple logging would not give enough control on resource use. > It would be better imho to switch to log4j instead. > > Eventually a reload is shorthand for the sequence shutdown, startup. > Logging libraries should give their user control over when the shutdown > happens > exactly, so I would assume a reload won't be a problem if implemented > as a shutdown of the logging subsystem followed by a startup. > > =A0 =A0 =A0 =A0regards, Andre > > -----Original Message----- > From: Janne Jalkanen [mailto:janne.jalkanen@ecyrd.com] > Sent: maandag 7 september 2009 8:26 > To: jspwiki-dev@incubator.apache.org > Subject: Re: Restart logging? > > > I don't think there's a simple way to do that through slf4j, simply > because log configuration is very specific to the actual logging > library used. For example, java.util.logging has a single global > LogManager, and to restart that one would mean writing our own > ClassLoader... > > However, since this is about first-use experience, it's unlikely that > someone would both be savvy enough to first switch the logging library > - THEN go and apply the easy-install process. So we might get away > simply by reconfiguring whichever logging library we happen to be > shipping with. > > Another possibility is to switch to Simple logging, which always goes > to stdout - in Tomcat's case, catalina.out. =A0Then there would be no > need to provide configuration on Install.jsp, which would simplify our > install process even more. > > /Janne > > On 7 Sep 2009, at 00:52, Andrew Jaquith wrote: > >> Hi Harry, >> >> The idea is to configure the wiki, including logging settings, using >> the installer screen. Then, after pressing the "Configure!" button, >> presto! the wiki is configured the way it should be without needing to >> restart the webapp. Instant gratification! It is much better than >> having to restart the webapp. >> >> Right now, in my local builds, everything *except* the log file change >> seems to work fine. The goal is to have the desired log file location >> (configured via the installer) reflected immediately -- the logs start >> going to that file. So I want to know how best to do that. Whether it >> is JMX or whatever, I don't care. But I am not a logging expert; hence >> the broadcast. If you have ideas I'd like to hear about them. >> >> Andrew >> >> On Sun, Sep 6, 2009 at 12:45 PM, Harry >> Metske wrote: >>> Well, >>> >>> we have our own logging layer (org.apache.wiki.log) which talks to >>> slf4j >>> which talks to a real logging implementation (with log4j as the >>> default). >>> The first two don't have support for configuring logging at all, >>> the writer >>> of slf4j says you also shouldn't : >>> http://www.slf4j.org/faq.html#configure_logging >>> Log4j itself does support dynamic configuration of logging, but >>> that has >>> explicitly not been put in the slf4j interface. >>> >>> We do however have some way of dynamically configuring our loggers, >>> and >>> that's through the MBeans (currently you have to use jconsole to do >>> it, but >>> a nice GUI for it would still be nice). This is however limited. >>> >>> So with "restart logging" you could something in that direction, >>> but again, >>> that is limited to log4j, if you run another logging >>> implementation, you are >>> left alone in the dark. >>> >>> BTW, what exactly would be the difference between restarting the >>> engine and >>> reloading the whole webapp ? >>> >>> regards, >>> Harry >>> >>> 2009/9/6 Andrew Jaquith >>> >>>> Hi all -- >>>> >>>> I am doing a bunch of work on the installer/config code. I've >>>> already >>>> got some really cool features implemented (LDAP config and live >>>> testing, Stripesification of the interface, configuration of >>>> multiple >>>> properties files simultaneously...). One thing I would REALLY like >>>> to >>>> do is to be able to apply changes to the wiki WITHOUT requiring a >>>> webapp reload. >>>> >>>> To that end, I wrote a restart() method for the WikiEngine, and it >>>> seems to work perfectly except in one respect: I can't figure out >>>> how >>>> to restart the logging subsystem. Any hints? I'd like to be able to >>>> allow the admin to specify the desired log file location, and after >>>> restart all of the logging is redirected there. >>>> >>>> Actually, there is one more thing: how does one set the Priha page >>>> directory? I'm pretty sure there's a setting in priha.properties >>>> that >>>> needs to be set, but I don't know what it is. >>>> >>>> Andrew >>>> >>> > >