log4j 2 - configuration issue

前端 未结 12 784
执笔经年
执笔经年 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:49

    It exists in the classpath of the project and I tried putting it in many other directories.

    Where exactly? There is often confusion about where "in the classpath" means. It can't just be anywhere. It has to be at the 'top' or the 'default package'.

    src
    ├── main
    │   └── java
    │       ├── com
    │       │   └── example
    │       └── log4j2.xml
    

提交回复
热议问题