My project requires an api end point to GET the initial log levels (configured/effective) of the packages, we create a scheduler to report that package log level is modified by the specific user from initial level : "info" to say "DEBUG" level.
we are planning to use below approach:
Whenever User hit the post actuator/logger/com.java api endpoint, initial log level is stored to a static map.
To achieve the above, Extend the Log4J2LoggingSystem class and override the method "setLogLevel" to store the initial level of the package to a static map before updating the user log level.
before taking this approach, want to know , if we have any method that spring stores the initial log level of the packages which can be leveraged rather than overriding the Log4J2LoggingSystem post call. If there isn't any , can you please share of any documentation to say we can customize the loggersendpoint.
Also please guide me if any other approach can be used to achieve this.
Thanks.