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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
