1 year ago

#386544

test-img

Dhruv

Edit log4j2 composite configuration via JMX

  • I am trying to change log levels, as well as add/remove loggers from an app we have without editing it's code/changing the multiple log4j configs it has.
  • I am able to do all these steps for applications with single log4j config xml
  • But for apps with multiple configurations, I am not able to retrieve the composite configuration via JMX (it just shows blank, I am just able to change levels for configured loggers, I also want to add new loggers/remove them), and hence cannot edit it.
  • Is there any way I can retrieve the config for such scenario using JMX? (Or any better alternative?)
  • Sharing some images:
  1. output of getConfigText operation in jconsole for a project with multiple log4j configs Here is the output of getConfigText operation in jconsole for a project with multiple log4j configs

  2. for a project with single log4j config

This one for a project with single log4j config

java

log4j

log4j2

jmx

jconsole

0 Answers

Your Answer

Accepted video resources