Sid Quraishi
Sid Quraishi

Reputation: 33

log4j2 set up issues

For some reason my log4j2 won't write anything lower than error on the screen. I have very basic code:

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

public class TestEN
{
    static Logger logger = LogManager.getLogger(TestEN.class);
    public static void main(String[] args)
    {
        logger.fatal("Test");
        logger.warn("Test");
    }
}

This only outputs:

16:31:59.883 [main] FATAL TestEN - Test

I don't have a log4j2.xml file set up for this project. I'm so confused... Any help would be great.

Upvotes: 0

Views: 129

Answers (1)

user180100
user180100

Reputation:

Did you read the manual about autoconfiguration?

Quote:

6 . If no configuration file could be located the DefaultConfiguration will be used. This will cause logging output to go to the console.

and DefaultConfiguration source shows default log level being "error"

Upvotes: 3

Related Questions