logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marko Asplund <marko.aspl...@kronodoc.com>
Subject Re: How to set log levels with jconsole?
Date Thu, 10 Aug 2006 17:36:19 GMT

On 2006-08-08, at 20.41, Marko Asplund wrote:

> I'm trying to figure out how to setup a Java SE 5 application so  
> that jconsole can be used for modifying log levels at run time.
> I'd appreciate any pointers or hints on how to do this.

The following lines of code seem to do the job:

MBeanServer server =  ManagementFactory.getPlatformMBeanServer();
HierarchyDynamicMBean h = new HierarchyDynamicMBean();
server.registerMBean(h, new ObjectName("log4j:hierarchy=default"));

I can monitor the appenders as well as the root and the explicitly  
added logger through JConsole. I'm also able to modify appender  
config but also change log levels at run time. Other loggers can be  
manually added with JConsole as needed.

Is the JMX support in log4j v1.2.13 considered production quality?  
Are there any caveats I should be aware of?


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

View raw message