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

Reply via email to