[logback-user] Some loggers do not display anything

Martial Lapeyre lapeyre.martial at gmail.com
Tue Mar 17 15:27:49 CET 2020

I have created the following configuration

<?xml version="1.0" encoding="UTF-8" ?>
<configuration scan="true">
   <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
            <pattern>%d{HH:mm:ss.SSS} [%-18.18thread]
%highlight(%-5level) %-30.30logger - %msg%n</pattern>
    <logger name="events.B" level="trace">
        <appender-ref ref="STDOUT"/>
    <logger name="events.A" level="trace" >
        <appender-ref ref="STDOUT"/>
    <root level="info"/>

When i use the following main

public static void main(String[] args) throws InterruptedException {
    Logger loggerA = LoggerFactory.getLogger("events.A");
    Logger loggerB = LoggerFactory.getLogger("events.B");
    loggerA.trace("I am A");
    loggerB.trace("I am B");

It displays only
15:22:11.746 [main              ] TRACE events.A                       - I
am A

Process finished with exit code 0
I do not understand why the entry from the second logger is not displayed
Note: I use the system property logback.configurationFile for setting the
configuration file.

Thank you for your help.

Martial Lapeyre
Courriel: lapeyre.martial at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20200317/77696f6a/attachment.html>

More information about the logback-user mailing list