What logs are printed?

Report a typo

Look at this code:

import org.apache.logging.log4j.Level
import org.apache.logging.log4j.kotlin.logger

fun main() {

    val logger = logger("Main")
    logger.log(Level.ERROR, "This is the error level")
    logger.info("This is the info level")
    logger.log(Level.INFO, "And this is the info level too")
}

Below is the configuration file log4j2.properties:

status = error

appender.console.type = Console
appender.console.name = LogToConsole
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %m%n

rootLogger.level = error
rootLogger.appenderRef.stdout.ref = LogToConsole

What log text will be printed in the console?

Enter a short text
___

Create a free account to access the full topic