: var ctx = (LoggerContext) LogManager.getContext(false);
: var current = ctx.getConfiguration();
: try {
: ctx.setConfiguration(myQuietConfiguration);
: otherCode();
: } finally {
: ctx.setConfiguration(current);
: }
:
: But it doesn't. Neither with reconfigure nor with setConfiguration.
: The root logger's appenders are never reattached properly.
:
: I wonder what I'm missing here. I've tried several other avenues but I
Dawid: The piece you're missing is LoggerContext.updateLoggers(...)
You can see examples of what you're describing in Solr's @LogLevel
and ErrorLogMuter ...
https://github.com/apache/solr/blob/main/solr/test-framework/src/java/org/apache/solr/util/LogLevel.java
https://github.com/apache/solr/blob/main/solr/test-framework/src/java/org/apache/solr/util/ErrorLogMuter.java
-Hoss
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]