From here
You don’t need to declare separate loggers to achieve this. You can set the logging level on the AppenderRef element.
And xml example (part):
<Root level="trace">
<AppenderRef ref="file" level="DEBUG"/>
<AppenderRef ref="STDOUT" level="INFO"/>
</Root>
But I can't find a way to do it when I create configuration myself. For example I have consoleAppenderBuilder and rootLoggerBuilder:
AppenderComponentBuilder consoleAppenderBuilder = builder
.newAppender("Stdout", "CONSOLE")
.addAttribute("target", ConsoleAppender.Target.SYSTEM_OUT);
RootLoggerComponentBuilder rootLoggerBuilder = builder
.newRootLogger(Level.ERROR)
.add(builder.newAppenderRef("Stdout"));
How to add console appender to root logger and define log level for appender. I am asking this because I want to add multiple appenders to root logger.