You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Dave Kriewall <Da...@Attachmate.com> on 2014/06/17 22:06:11 UTC

Using JMX to change the log level of a LoggerConfig

I am trying to dynamically change the log level of a given LoggerConfig using jconsole via the JMX interface.  This is currently possible by going to the org.apache.logging.log4j2.Default.Loggers tree in jconsole's MBeans pane, choosing the desired logger, and typing a new Level value (such as "DEBUG") in the "Attribute values" panel.  But it has no effect because LoggerContext.updateLoggers() is not called.  Is there a way to invoke updateLoggers() via JMX?

If not, could LoggerContextAdmin be enhanced to expose updateLoggers() as an action?  Or better, invoke updateLoggers() as a side effect of LoggerConfigAdmin.setLevel() -- which saves a step.

Thanks!
-Dave

Re: Using JMX to change the log level of a LoggerConfig

Posted by Remko Popma <re...@gmail.com>.
Dave,

This has been fixed in trunk and will be in the next release (rc2).

Best regards,
Remko

Sent from my iPhone

> On 2014/06/18, at 5:06, Dave Kriewall <Da...@Attachmate.com> wrote:
> 
> I am trying to dynamically change the log level of a given LoggerConfig using jconsole via the JMX interface.  This is currently possible by going to the org.apache.logging.log4j2.Default.Loggers tree in jconsole's MBeans pane, choosing the desired logger, and typing a new Level value (such as "DEBUG") in the "Attribute values" panel.  But it has no effect because LoggerContext.updateLoggers() is not called.  Is there a way to invoke updateLoggers() via JMX?
> 
> If not, could LoggerContextAdmin be enhanced to expose updateLoggers() as an action?  Or better, invoke updateLoggers() as a side effect of LoggerConfigAdmin.setLevel() -- which saves a step.
> 
> Thanks!
> -Dave

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