Change the log level programatically in Confluence at runtime

It is really hard for system administrators to change the correct log levels before reproducing a bug and sending us the logs, it’s a lot of steps to explain to customers - so we have a UI to change the log levels for them. It was very useful, the customers could really extract logs of excellent quality.

Confluence is removing access to org.apache.log4j, so we are not able to change log levels when the administrator clicks in the UI.

Is there any way that a plugin can programatically change the log levels of slf4j/log4j at runtime, in Java?