Why is Log4j rootLogger not filtering log events according to event level?

后端 未结 3 1922
一生所求
一生所求 2021-01-02 15:50

Why is the Log4j rootLogger in my application not filtering log events according to level? In my log4j.properties, I have several loggers:

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-02 15:55

    Check out the inheritance described in the intro. If you specify a level at the package level, it won't inherit the root logger's level. You're using debug in the packages you specify, not info. Specifying the level overrides whatever has been inherited.

    If you want to inherit the root logger's level, get rid of the level specification in your logger configurations.

提交回复
热议问题