<p>Let's say, I have a spring boot application where I am using Log4j for logging.
In there, I want to change the log level dynamically without staring the whole application.<br />
This can be achieved by exposing some endpoint to set the levels.
But, at production level, there might be <strong>multiple instances of the same application</strong> running across different servers.<br />
So, how can we set the logging levels dynamically across all the container instances running the applications which are managed by kubernetes?</p>

lnx
<p>Not sure how config maps on K8s will solve the probleme.
The environment variable, command line arguments and config files are used/read once the application is started. Any change on them wont be reflacted to the app, without a restart.</p>
<p>One solution that I use is to set a scan interval on the logger library (log4j or logback).
For example on logback there is a auto-scan configuration parameter
<a href="https://logback.qos.ch/manual/configuration.html#autoScan" rel="nofollow noreferrer">https://logback.qos.ch/manual/configuration.html#autoScan</a>.</p>
<p>This allows the application to check regularly with the defined interval the changes on the config file where you define the log-levels.
Hence even if you use multiple instances of your application, all of them will scan the same config file and be updated without a restart.</p>
