logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Davies <gedav...@yahoo.com>
Subject Re: Changing log level without restarting app server
Date Thu, 13 Aug 2009 20:03:08 GMT
I took a different approach to watching the file.  I had a servlet simply reload it when a
parameter on a url was called.  The servlet then simply did:
        URL url = Loader.getResource("log4j.xml");
        DOMConfigurator.configure(url);


Works fine for me.  Not exceptions or errors and works like a charm.

Geoff.


----- Original Message ----
From: AL <annielaney@gmail.com>
To: "log4j-user@logging.apache.org" <log4j-user@logging.apache.org>
Sent: Thursday, August 13, 2009 10:23:55 AM
Subject: Changing log level without restarting app server

Hey everyone,

I have a J2EE app using EJB 2.1, Struts 1 and Hibernate, running on JBoss 4.2.3 and want to
be able to modify various properties in log4j.properties without having to restart the app
server, e.g. Change the log level from info to debug.

What's the best way to get this set up?Should it be done in a servlet upon application startup?
I've googled this but haven't found a definitive best practice solution. I've tried configure
and watch but it throws exceptions when I change the log level and save the file..

Thanks for any help!

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


      

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message