Log4j 2
  1. Log4j 2
  2. LOG4J2-441

logger level configuration does not work correct

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None

      Description

      Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
      Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
      Column 7 is the actual output
      Column 8 is the expected Output

      For instance the first row of the table shows a logging result which I not expected in that way. You can take log4j2.xml.row1 to reproduce the first row. The first logger is named "com". The second logger is named "com.log4jtest" and the third logger is named "com.log4jtest.test". This looks like a bug in log4j 2.0:
      Logger1 considers the levels

      {info, debug, warning}

      but not the level trace. What is the default level, if there is no level defined at the logger header and also not at the appender-ref? Here it seems that the Logger1 has the level debug as default which is not clear for me. For me it would make sense if the default level is either OFF or ALL when there is no explicit level set. But either way there should be a clear rule for this. The other rows are showing similar inconsistent logging behaviour.

      1 2 3 4 5 6 7 8
      level 1 logger level 1 appender-ref level 2 logger level 2 appender-ref level 3 logger level 3 appender-ref actual output expected output
      - - - info debug debug Logger3: info logger
      Logger2: info logger
      Logger1: info logger
      Logger3: debug logger
      Logger1: debug logger
      Logger3: warning logger
      Logger2: warning logger
      Logger1: warning logger
      Logger3: info logger
      Logger2: info logger
      Logger3: debug logger
      Logger3: warning logger
      Logger2: warning logger
      - - - info - debug no output Logger3: info logger
      Logger2: info logger
      Logger3: debug logger
      Logger3: warning logger
      Logger2: warning logger
      - - info info - debug no output Logger3: info logger
      Logger2: info logger
      Logger3: debug logger
      Logger3: warning logger
      Logger2: warning logger
      fatal fatal info info - debug no output Logger3: info logger
      Logger2: info logger
      Logger3: debug logger
      Logger3: warning logger
      Logger2: warning logger
      info info info info - debug no output Logger3: info logger
      Logger2: info logger
      Logger1: info logger
      Logger3: debug logger
      Logger3: warning logger
      Logger2: warning logger
      Logger1: warning logger
      debug debug info info   debug no output Logger3: info logger
      Logger2: info logger
      Logger1: info logger
      Logger3: debug logger
      Logger3: warning logger
      Logger2: warning logger
      Logger1: warning logger
      info debug info info - debug no output Logger3: info logger
      Logger2: info logger
      Logger1: info logger
      Logger3: debug logger
      Logger3: warning logger
      Logger2: warning logger
      Logger1: warning logger
      debug info info info - debug no output Logger3: info logger
      Logger2: info logger
      Logger1: info logger
      Logger3: debug logger
      Logger3: warning logger
      Logger2: warning logger
      Logger1: warning logger
      debug trace info info - debug no output Logger3: info logger
      Logger2: info logger
      Logger1: info logger
      Logger3: debug logger
      Logger3: warning logger
      Logger2: warning logger
      Logger1: warning logger
      - - info info fatal debug no output Logger2: info logger
      Logger2: warning logger
      - - info info trace debug Logger3: info logger
      Logger2: info logger
      Logger1: info logger
      Logger3: debug logger
      Logger1: debug logger
      Logger3: warning logger
      Logger2: warning logger
      Logger1: warning logger
      Logger1: trace logger
      Logger3: info logger
      Logger2: info logger
      Logger3: debug logger
      Logger2: warning logger
      - - - info trace debug Logger3: info logger
      Logger2: info logger
      Logger1: info logger
      Logger3: debug logger
      Logger1: debug logger
      Logger3: warning logger
      Logger2: warning logger
      Logger1: warning logger
      Logger1: trace logger
      Logger3: info logger
      Logger2: info logger
      Logger3: debug logger
      Logger2: warning logger
      - - info - trace debug Logger3: info logger
      Logger2: info logger
      Logger1: info logger
      Logger3: debug logger
      Logger1: debug logger
      Logger3: warning logger
      Logger2: warning logger
      Logger1: warning logger
      Logger1: trace logger
      Logger3: info logger
      Logger2: info logger
      Logger3: debug logger
      Logger2: warning logger

      Here is the log4j2.xml:

      <?xml version="1.0" encoding="UTF-8" ?>
      <configuration>
      	<appenders>
      		<console name="TestConsole0">
      			<PatternLayout pattern="RootLogger: %msg%n"/>
      		</console>
      		<console name="TestConsole1">
      			<PatternLayout pattern="Logger1: %msg%n"/>
      		</console>
      		<console name="TestConsole2">
      			<PatternLayout pattern="Logger2: %msg%n"/>
      		</console>
      		<console name="TestConsole3">
      			<PatternLayout pattern="Logger3: %msg%n"/>
      		</console>
      	</appenders>
      	
      	<loggers>
      		<logger name="com" >
      			<appender-ref ref="TestConsole1" />
      		</logger>
      		
      		<logger name ="com.log4jtest" level="info">
      			<appender-ref ref="TestConsole2" level="info"/>
      		</logger>
      		
      		<logger name ="com.log4jtest.test" level="fatal">
      			<appender-ref ref="TestConsole3" level="debug"/>
      		</logger>
      		
      		<root level="error">
      			<appender-ref ref="TestConsole0" level="error"/>
      		</root>
      	</loggers>
      </configuration>
      

      And here are the logging calls:

      Log4j2LogLevelTest.java
      package com.log4jtest.test;
      
      import static org.junit.Assert.*;
      
      import org.apache.logging.log4j.LogManager;
      import org.apache.logging.log4j.Logger;
      import org.junit.Test;
      
      public class Log4j2LogLevelTest {
      
      	private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);
      	
      	@Test
      	public void testLogLevel() {
      		logger.info("info logger");
      		logger.debug("debug logger");
      		logger.warn("warning logger");
      		logger.trace("trace logger");
      	}
      
      }
      
      1. log4j2.xml.row9
        0.9 kB
        Andreas Rytina
      2. log4j2.xml.row8
        0.9 kB
        Andreas Rytina
      3. log4j2.xml.row7
        0.9 kB
        Andreas Rytina
      4. log4j2.xml.row6
        0.9 kB
        Andreas Rytina
      5. log4j2.xml.row5
        0.9 kB
        Andreas Rytina
      6. log4j2.xml.row4
        0.9 kB
        Andreas Rytina
      7. log4j2.xml.row3
        0.9 kB
        Andreas Rytina
      8. log4j2.xml.row2
        0.9 kB
        Andreas Rytina
      9. log4j2.xml.row13
        0.9 kB
        Andreas Rytina
      10. log4j2.xml.row12
        0.9 kB
        Andreas Rytina
      11. log4j2.xml.row11
        0.9 kB
        Andreas Rytina
      12. log4j2.xml.row10
        0.9 kB
        Andreas Rytina
      13. log4j2.xml.row1
        0.9 kB
        Andreas Rytina

        Activity

        Andreas Rytina created issue -
        Andreas Rytina made changes -
        Field Original Value New Value
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        |level.1.logger|level.1.appender-ref|level.2.logger|level.2.appender-ref|level.3.logger |level.3.appender-ref|actual output|expected output|
        ||||info|debug|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        ||||info||debug||Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |||info|info||debug||Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |fatal|fatal|info|info||debug||Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |info|info|info|info||debug||Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|debug|info|info| |debug||Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |info|debug|info|info||debug||Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|info|info|info||debug||Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|trace|info|info||debug||Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |||info|info|fatal|debug||Logger2: info logger<br>Logger2: warning logger|
        |||info|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        ||||info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |||info||trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger2: trace logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        |level.1.logger|level.1.appender-ref|level.2.logger|level.2.appender-ref|level.3.logger |level.3.appender-ref|actual output|expected output|
        |-|-|-|info|debug|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-||info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |-||info|info|fatal|debug|-|Logger2: info logger<br>Logger2: warning logger|
        |-||info|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-||-|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-||info|-|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger2: trace logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        Andreas Rytina made changes -
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        |level.1.logger|level.1.appender-ref|level.2.logger|level.2.appender-ref|level.3.logger |level.3.appender-ref|actual output|expected output|
        |-|-|-|info|debug|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-||info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |-||info|info|fatal|debug|-|Logger2: info logger<br>Logger2: warning logger|
        |-||info|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-||-|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-||info|-|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger2: trace logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        |level.1.logger|level.1.appender-ref|level.2.logger|level.2.appender-ref|level.3.logger |level.3.appender-ref|actual output|expected output|
        |-|-|-|info|debug|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |-|info|info|fatal|debug|-|Logger2: info logger<br>Logger2: warning logger|
        |-|info|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|info|-|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger2: trace logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        Andreas Rytina made changes -
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        |level.1.logger|level.1.appender-ref|level.2.logger|level.2.appender-ref|level.3.logger |level.3.appender-ref|actual output|expected output|
        |-|-|-|info|debug|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |-|info|info|fatal|debug|-|Logger2: info logger<br>Logger2: warning logger|
        |-|info|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|info|-|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger2: trace logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        |level.1.logger|level.1.appender-ref|level.2.logger|level.2.appender-ref|level.3.logger |level.3.appender-ref|actual output|expected output|
        |-|-|-|info|debug|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger<br>Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger2: trace logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        Andreas Rytina made changes -
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        |level.1.logger|level.1.appender-ref|level.2.logger|level.2.appender-ref|level.3.logger |level.3.appender-ref|actual output|expected output|
        |-|-|-|info|debug|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger<br>Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger2: trace logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        |level.1.logger|level.1.appender-ref|level.2.logger|level.2.appender-ref|level.3.logger |level.3.appender-ref|actual output|expected output|
        |-|-|-|info|debug|debug|Logger3: info logger</br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger<br>Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger2: trace logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        Andreas Rytina made changes -
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        |level.1.logger|level.1.appender-ref|level.2.logger|level.2.appender-ref|level.3.logger |level.3.appender-ref|actual output|expected output|
        |-|-|-|info|debug|debug|Logger3: info logger</br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger<br>Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger2: trace logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        |level.1.logger|level.1.appender-ref|level.2.logger|level.2.appender-ref|level.3.logger |level.3.appender-ref|actual output|expected output|
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger<br>Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger2: trace logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        Andreas Rytina made changes -
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        |level.1.logger|level.1.appender-ref|level.2.logger|level.2.appender-ref|level.3.logger |level.3.appender-ref|actual output|expected output|
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger<br>Logger1: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger1: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger<br>Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger2: debug logger<br>Logger3: warning logger<br>Logger2: warning logger<br>Logger2: trace logger|Logger3: info logger<br>Logger2: info logger<br>Logger3: debug logger<br>Logger3: warning logger<br>Logger2: warning logger|
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        |level.1.logger|level.1.appender-ref|level.2.logger|level.2.appender-ref|level.3.logger |level.3.appender-ref|actual output|expected output|
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger2: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        Andreas Rytina made changes -
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        |level.1.logger|level.1.appender-ref|level.2.logger|level.2.appender-ref|level.3.logger |level.3.appender-ref|actual output|expected output|
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger2: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        ||level.1.logger||level.1.appender-ref||level.2.logger||level.2.appender-ref||level.3.logger ||level.3.appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger2: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        Andreas Rytina made changes -
        Attachment log4jtest.zip [ 12612404 ]
        Andreas Rytina made changes -
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        ||level.1.logger||level.1.appender-ref||level.2.logger||level.2.appender-ref||level.3.logger ||level.3.appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger2: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        ||level.1.logger||level.1.appender-ref||level.2.logger||level.2.appender-ref||level.3.logger ||level.3.appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger2: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        Andreas Rytina made changes -
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        ||level.1.logger||level.1.appender-ref||level.2.logger||level.2.appender-ref||level.3.logger ||level.3.appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger2: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        ||level.1.logger||level.1.appender-ref||level.2.logger||level.2.appender-ref||level.3.logger ||level.3.appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger2: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Bar.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Andreas Rytina made changes -
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        ||level.1.logger||level.1.appender-ref||level.2.logger||level.2.appender-ref||level.3.logger ||level.3.appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger2: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Bar.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        ||level.1.logger||level.1.appender-ref||level.2.logger||level.2.appender-ref||level.3.logger ||level.3.appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger2: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Log4j2LogLevelTest.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Remko Popma made changes -
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        ||level.1.logger||level.1.appender-ref||level.2.logger||level.2.appender-ref||level.3.logger ||level.3.appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger2: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Log4j2LogLevelTest.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        ||level 1 logger||level 1 appender-ref||level 2 logger||level 2 appender-ref||level 3 logger ||level 3 appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger2: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Log4j2LogLevelTest.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Andreas Rytina made changes -
        Attachment log4j2.xml.row1 [ 12612603 ]
        Attachment log4j2.xml.row2 [ 12612604 ]
        Attachment log4j2.xml.row3 [ 12612605 ]
        Attachment log4j2.xml.row4 [ 12612606 ]
        Attachment log4j2.xml.row5 [ 12612607 ]
        Attachment log4j2.xml.row6 [ 12612608 ]
        Attachment log4j2.xml.row7 [ 12612609 ]
        Attachment log4j2.xml.row8 [ 12612610 ]
        Attachment log4j2.xml.row9 [ 12612611 ]
        Attachment log4j2.xml.row10 [ 12612612 ]
        Attachment log4j2.xml.row11 [ 12612613 ]
        Attachment log4j2.xml.row12 [ 12612614 ]
        Attachment log4j2.xml.row13 [ 12612615 ]
        Andreas Rytina made changes -
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output
        I also attached the test which can be taken to reproduce the according behaviour.

        |1|2|3|4|5|6|7|8|
        ||level 1 logger||level 1 appender-ref||level 2 logger||level 2 appender-ref||level 3 logger ||level 3 appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|-|Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|-|Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|-|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger2: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Log4j2LogLevelTest.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output

        For instance the first row of the table shows a logging result which I not expected in that way. This looks like a bug in log4j 2.0:
        Logger1 considers the levels {info, debug, warning} but not the level trace. So what is the default level, if there is no level defined at the logger header and also not at the appender-ref? Here it seems that the Logger1 has the level debug as default which is not clear for me. For me it would make sense if the default level is either OFF or ALL when there is no explicit level set. But either way there should be a clear rule for this. The other rows are showing similare inconsistent logging behaviour.

        |1|2|3|4|5|6|7|8|
        ||level 1 logger||level 1 appender-ref||level 2 logger||level 2 appender-ref||level 3 logger ||level 3 appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|no output|
        Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|no output|
        Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|no output|
        Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="com" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Log4j2LogLevelTest.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Andreas Rytina made changes -
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output

        For instance the first row of the table shows a logging result which I not expected in that way. This looks like a bug in log4j 2.0:
        Logger1 considers the levels {info, debug, warning} but not the level trace. So what is the default level, if there is no level defined at the logger header and also not at the appender-ref? Here it seems that the Logger1 has the level debug as default which is not clear for me. For me it would make sense if the default level is either OFF or ALL when there is no explicit level set. But either way there should be a clear rule for this. The other rows are showing similare inconsistent logging behaviour.

        |1|2|3|4|5|6|7|8|
        ||level 1 logger||level 1 appender-ref||level 2 logger||level 2 appender-ref||level 3 logger ||level 3 appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|no output|
        Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|no output|
        Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|no output|
        Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="com" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Log4j2LogLevelTest.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output

        For instance the first row of the table shows a logging result which I not expected in that way. This looks like a bug in log4j 2.0:
        Logger1 considers the levels {info, debug, warning} but not the level trace. So what is the default level, if there is no level defined at the logger header and also not at the appender-ref? Here it seems that the Logger1 has the level debug as default which is not clear for me. For me it would make sense if the default level is either OFF or ALL when there is no explicit level set. But either way there should be a clear rule for this. The other rows are showing similare inconsistent logging behaviour.

        |1|2|3|4|5|6|7|8|
        ||level 1 logger||level 1 appender-ref||level 2 logger||level 2 appender-ref||level 3 logger ||level 3 appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|no output|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="com" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Log4j2LogLevelTest.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Andreas Rytina made changes -
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output

        For instance the first row of the table shows a logging result which I not expected in that way. This looks like a bug in log4j 2.0:
        Logger1 considers the levels {info, debug, warning} but not the level trace. So what is the default level, if there is no level defined at the logger header and also not at the appender-ref? Here it seems that the Logger1 has the level debug as default which is not clear for me. For me it would make sense if the default level is either OFF or ALL when there is no explicit level set. But either way there should be a clear rule for this. The other rows are showing similare inconsistent logging behaviour.

        |1|2|3|4|5|6|7|8|
        ||level 1 logger||level 1 appender-ref||level 2 logger||level 2 appender-ref||level 3 logger ||level 3 appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|no output|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="com" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Log4j2LogLevelTest.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output

        For instance the first row of the table shows a logging result which I not expected in that way. This looks like a bug in log4j 2.0:
        Logger1 considers the levels {info, debug, warning} but not the level trace. So what is the default level, if there is no level defined at the logger header and also not at the appender-ref? Here it seems that the Logger1 has the level debug as default which is not clear for me. For me it would make sense if the default level is either OFF or ALL when there is no explicit level set. But either way there should be a clear rule for this. The other rows are showing similar inconsistent logging behaviour.

        |1|2|3|4|5|6|7|8|
        ||level 1 logger||level 1 appender-ref||level 2 logger||level 2 appender-ref||level 3 logger ||level 3 appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|no output|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="com" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Log4j2LogLevelTest.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Andreas Rytina made changes -
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output

        For instance the first row of the table shows a logging result which I not expected in that way. This looks like a bug in log4j 2.0:
        Logger1 considers the levels {info, debug, warning} but not the level trace. So what is the default level, if there is no level defined at the logger header and also not at the appender-ref? Here it seems that the Logger1 has the level debug as default which is not clear for me. For me it would make sense if the default level is either OFF or ALL when there is no explicit level set. But either way there should be a clear rule for this. The other rows are showing similar inconsistent logging behaviour.

        |1|2|3|4|5|6|7|8|
        ||level 1 logger||level 1 appender-ref||level 2 logger||level 2 appender-ref||level 3 logger ||level 3 appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|no output|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="com" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Log4j2LogLevelTest.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output

        For instance the first row of the table shows a logging result which I not expected in that way. You can take log4j2.xml.row1 to reproduce the first row. I renamed the first logger to "com". This looks like a bug in log4j 2.0:
        Logger1 considers the levels {info, debug, warning} but not the level trace. So what is the default level, if there is no level defined at the logger header and also not at the appender-ref? Here it seems that the Logger1 has the level debug as default which is not clear for me. For me it would make sense if the default level is either OFF or ALL when there is no explicit level set. But either way there should be a clear rule for this. The other rows are showing similar inconsistent logging behaviour.

        |1|2|3|4|5|6|7|8|
        ||level 1 logger||level 1 appender-ref||level 2 logger||level 2 appender-ref||level 3 logger ||level 3 appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|no output|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="com" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Log4j2LogLevelTest.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Andreas Rytina made changes -
        Attachment log4jtest.zip [ 12612404 ]
        Andreas Rytina made changes -
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output

        For instance the first row of the table shows a logging result which I not expected in that way. You can take log4j2.xml.row1 to reproduce the first row. I renamed the first logger to "com". This looks like a bug in log4j 2.0:
        Logger1 considers the levels {info, debug, warning} but not the level trace. So what is the default level, if there is no level defined at the logger header and also not at the appender-ref? Here it seems that the Logger1 has the level debug as default which is not clear for me. For me it would make sense if the default level is either OFF or ALL when there is no explicit level set. But either way there should be a clear rule for this. The other rows are showing similar inconsistent logging behaviour.

        |1|2|3|4|5|6|7|8|
        ||level 1 logger||level 1 appender-ref||level 2 logger||level 2 appender-ref||level 3 logger ||level 3 appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|no output|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="com" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Log4j2LogLevelTest.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output

        For instance the first row of the table shows a logging result which I not expected in that way. You can take log4j2.xml.row1 to reproduce the first row. The first logger is named "com". The second logger is named "com.log4jtest" and the third logger is named "com.log4jtest.test". This looks like a bug in log4j 2.0:
        Logger1 considers the levels {info, debug, warning} but not the level trace. So what is the default level, if there is no level defined at the logger header and also not at the appender-ref? Here it seems that the Logger1 has the level debug as default which is not clear for me. For me it would make sense if the default level is either OFF or ALL when there is no explicit level set. But either way there should be a clear rule for this. The other rows are showing similar inconsistent logging behaviour.

        |1|2|3|4|5|6|7|8|
        ||level 1 logger||level 1 appender-ref||level 2 logger||level 2 appender-ref||level 3 logger ||level 3 appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|no output|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="com" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Log4j2LogLevelTest.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Andreas Rytina made changes -
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output

        For instance the first row of the table shows a logging result which I not expected in that way. You can take log4j2.xml.row1 to reproduce the first row. The first logger is named "com". The second logger is named "com.log4jtest" and the third logger is named "com.log4jtest.test". This looks like a bug in log4j 2.0:
        Logger1 considers the levels {info, debug, warning} but not the level trace. So what is the default level, if there is no level defined at the logger header and also not at the appender-ref? Here it seems that the Logger1 has the level debug as default which is not clear for me. For me it would make sense if the default level is either OFF or ALL when there is no explicit level set. But either way there should be a clear rule for this. The other rows are showing similar inconsistent logging behaviour.

        |1|2|3|4|5|6|7|8|
        ||level 1 logger||level 1 appender-ref||level 2 logger||level 2 appender-ref||level 3 logger ||level 3 appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|no output|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger2: info logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="com" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Log4j2LogLevelTest.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output

        For instance the first row of the table shows a logging result which I not expected in that way. You can take log4j2.xml.row1 to reproduce the first row. The first logger is named "com". The second logger is named "com.log4jtest" and the third logger is named "com.log4jtest.test". This looks like a bug in log4j 2.0:
        Logger1 considers the levels {info, debug, warning} but not the level trace. So what is the default level, if there is no level defined at the logger header and also not at the appender-ref? Here it seems that the Logger1 has the level debug as default which is not clear for me. For me it would make sense if the default level is either OFF or ALL when there is no explicit level set. But either way there should be a clear rule for this. The other rows are showing similar inconsistent logging behaviour.

        |1|2|3|4|5|6|7|8|
        ||level 1 logger||level 1 appender-ref||level 2 logger||level 2 appender-ref||level 3 logger ||level 3 appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|no output|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="com" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Log4j2LogLevelTest.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Andreas Rytina made changes -
        Description Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output

        For instance the first row of the table shows a logging result which I not expected in that way. You can take log4j2.xml.row1 to reproduce the first row. The first logger is named "com". The second logger is named "com.log4jtest" and the third logger is named "com.log4jtest.test". This looks like a bug in log4j 2.0:
        Logger1 considers the levels {info, debug, warning} but not the level trace. So what is the default level, if there is no level defined at the logger header and also not at the appender-ref? Here it seems that the Logger1 has the level debug as default which is not clear for me. For me it would make sense if the default level is either OFF or ALL when there is no explicit level set. But either way there should be a clear rule for this. The other rows are showing similar inconsistent logging behaviour.

        |1|2|3|4|5|6|7|8|
        ||level 1 logger||level 1 appender-ref||level 2 logger||level 2 appender-ref||level 3 logger ||level 3 appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|no output|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="com" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Log4j2LogLevelTest.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Configuring the loglevel in the logger does not work in combination with configuring the loglevel at the appender-refs. I analyzed this with the beta9. See the table which lists various loglevel configurations for the 3 loggers. The column format for the table is:
        Column 1-6 are the logger with their level config (level@logger1, level@appender-ref)(level@logger2, level@appender-ref)(level@logger3, level@appender-ref)
        Column 7 is the actual output
        Column 8 is the expected Output

        For instance the first row of the table shows a logging result which I not expected in that way. You can take log4j2.xml.row1 to reproduce the first row. The first logger is named "com". The second logger is named "com.log4jtest" and the third logger is named "com.log4jtest.test". This looks like a bug in log4j 2.0:
        Logger1 considers the levels {info, debug, warning} but not the level trace. {color:red}What is the default level, if there is no level defined at the logger header and also not at the appender-ref?{color} Here it seems that the Logger1 has the level debug as default which is not clear for me. For me it would make sense if the default level is either OFF or ALL when there is no explicit level set. But either way there should be a clear rule for this. The other rows are showing similar inconsistent logging behaviour.

        |1|2|3|4|5|6|7|8|
        ||level 1 logger||level 1 appender-ref||level 2 logger||level 2 appender-ref||level 3 logger ||level 3 appender-ref||actual output||expected output||
        |-|-|-|info|debug|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|-|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |-|-|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |fatal|fatal|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger|
        |info|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|debug|info|info| |debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |info|debug|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|info|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |debug|trace|info|info|-|debug|no output|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger|
        |-|-|info|info|fatal|debug|no output|Logger2: info logger
        Logger2: warning logger|
        |-|-|info|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: warning logger|
        |-|-|-|info|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: warning logger|
        |-|-|info|-|trace|debug|Logger3: info logger
        Logger2: info logger
        Logger1: info logger
        Logger3: debug logger
        Logger1: debug logger
        Logger3: warning logger
        Logger2: warning logger
        Logger1: warning logger
        Logger1: trace logger|Logger3: info logger
        Logger2: info logger
        Logger3: debug logger
        Logger2: warning logger|

        Here is the log4j2.xml:
        {code:xml}
        <?xml version="1.0" encoding="UTF-8" ?>
        <configuration>
        <appenders>
        <console name="TestConsole0">
        <PatternLayout pattern="RootLogger: %msg%n"/>
        </console>
        <console name="TestConsole1">
        <PatternLayout pattern="Logger1: %msg%n"/>
        </console>
        <console name="TestConsole2">
        <PatternLayout pattern="Logger2: %msg%n"/>
        </console>
        <console name="TestConsole3">
        <PatternLayout pattern="Logger3: %msg%n"/>
        </console>
        </appenders>

        <loggers>
        <logger name="com" >
        <appender-ref ref="TestConsole1" />
        </logger>

        <logger name ="com.log4jtest" level="info">
        <appender-ref ref="TestConsole2" level="info"/>
        </logger>

        <logger name ="com.log4jtest.test" level="fatal">
        <appender-ref ref="TestConsole3" level="debug"/>
        </logger>

        <root level="error">
        <appender-ref ref="TestConsole0" level="error"/>
        </root>
        </loggers>
        </configuration>
        {code}

        And here are the logging calls:
        {code:title=Log4j2LogLevelTest.java|borderStyle=solid}
        package com.log4jtest.test;

        import static org.junit.Assert.*;

        import org.apache.logging.log4j.LogManager;
        import org.apache.logging.log4j.Logger;
        import org.junit.Test;

        public class Log4j2LogLevelTest {

        private static final Logger logger = LogManager.getLogger(Log4j2LogLevelTest.class);

        @Test
        public void testLogLevel() {
        logger.info("info logger");
        logger.debug("debug logger");
        logger.warn("warning logger");
        logger.trace("trace logger");
        }

        }
        {code}
        Ralph Goers made changes -
        Assignee Ralph Goers [ ralph.goers@dslextreme.com ]
        Ralph Goers made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Ralph Goers
            Reporter:
            Andreas Rytina
          • Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development