log4j 2 - configuration issue

前端 未结 12 790
执笔经年
执笔经年 2020-12-10 12:34

I am trying to configure log4j 2.0 to report logs.

My config is saved as log4j2.xml and this is its content:

  

        
12条回答
  •  长情又很酷
    2020-12-10 12:47

    I had the same 'ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.' message over and over. It made me crazy. The log4j2.xml file was placed correctly at src/main/resources, like i did at thousands of projects before.

    The solution in my case was to remove pom from the root pom.xml. packaging pom causes the content of src/main/resources not to be copied to target/classes.

    Happy logging for anyone with the same root cause.

提交回复
热议问题