Hello, looking for some advice, assuming this is possible.

I am working with a rather complex application and the log4j2 configuration is 
also complex (12+ loggers).

It is started at war deployment by a WEB-INF/classes/log4j2.xml file and then 
after the context is started, based on the host name (ie, environment: prod, 
test, dev), the logging levels are changed to desired defaults.

All of this works great. But now I need to build a control panel page that 
lists each appender/logger so certain settings can be changed or the file 
rotated at run time when situations arise.

I know I can get a copy of the configuration from the file, but remember above, 
those defaults have already been changed based on the host name.

I need to access the CURRENT in-memory configuration, but after digging through 
the API, I cannot find the right call for this, assuming it exists. Is there 
one?

My point being is that if I use the altered config default based on host name, 
change a logger level from A to B, do some work, and want to return to the 
control panel to return B to A or make some other change, I won't see the fact 
that A is already at B.

Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to