GitHub user paladox added a comment to the discussion: Help with migrating from
log4j to log4j2 (we also use a slf4j -> log4j)
Well I want to configure all the loggers in root to x if name isn't specified.
Although I guess it could be:
```
LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
ctx.getLoggerRegistry()
.getLoggers()
.forEach(
logger -> {
String loggerName = logger.getName();
if (name == null || loggerName.contains(name)) {
Configurator.setLevel(loggerName, newLevel);
}
});
```
GitHub link:
https://github.com/apache/logging-log4j2/discussions/3914#discussioncomment-14310895
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]