It is important to note that LoggerConfig objects are returned by getLoggers () and NOT by the registrars themselves. As vacant78 noted, this is only useful for configuring logs that have not yet been created. If you already have a bunch of logs that have already been created, changing the configuration using this method is not useful.
For example, to change the logging level at runtime, refer to this link, which uses the undocumented API in Apache (unsurprisingly), which will change all your currently created logging levels: Programmatically change the log level in Log4j2
Ketchup201
source share