My logback.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<jmxConfigurator/>
<statusListener class="ch.qos.logback.core.status.NopStatusListener"/>
<property name="LOG_DIR" value="/tmp/logs"/>
<springProperty name="appName" source="spring.application.name"/>
<appender class="ch.qos.logback.core.ConsoleAppender" name="STDOUT">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
some pattern
</Pattern>
</layout>
</appender>
<logger additivity="false" level="DEBUG"
name="xyz">
<appender-ref ref="STDOUT"/>
</logger>
<root level="ERROR">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
I am trying to disable DEBUG logs from the entire application and couldn't find a way to do so. I want to print INFO, ERROR level logs.
You can either leave the only root logger with INFO level. This means it would log only INFO, WARN and ERROR. However it seems that WARN is not something you would like to log.
Or you can use filters like LevelFilter. Below is the example from the documentation you can find by the provided link.
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>INFO</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<encoder>
<pattern>
%-4relative [%thread] %-5level %logger{30} - %msg%n
</pattern>
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="CONSOLE" />
</root>
</configuration>