How to configure logback to skip logging messages from org.package.* with all levels below WARN?

Vladislav Rastrusny picture Vladislav Rastrusny · May 7, 2011 · Viewed 19.8k times · Source

How do I configure logback not to log messages from loggers in package org.package and it's subpackages unless their level is WARN or ERROR?

Answer

Tomasz Nurkiewicz picture Tomasz Nurkiewicz · May 7, 2011

And why isn't the following configuration not working for you?

<configuration>
    <logger name="org.package" level="WARN"/>

    <root level="ALL">
        <appender class="ch.qos.logback.core.ConsoleAppender">
            <encoder>
                <pattern>%d{ISO8601} | %-5level | %thread | %logger{1} | %m%n</pattern>
            </encoder>
        </appender>
    </root>
</configuration>