开发者

Log4j - Log only specified method to file

开发者 https://www.devze.com 2023-01-29 05:36 出处:网络
Using log开发者_如何学Python4j to log specific events (DEBUG, ERROR, FATAL..) having specified in the properties file to log only DEBUG i still end up having other error messages logged in the file. I

Using log开发者_如何学Python4j to log specific events (DEBUG, ERROR, FATAL..) having specified in the properties file to log only DEBUG i still end up having other error messages logged in the file. Is there a way to tell log4j to log only specific events to a file?

Thank You.


Read on appender additivity. You must set it to false. A similar question was asked before on SO.

Relevant code snippet:

<category name="org.quartz" additivity="false">
    <priority value="DEBUG" />
</category>

Version for a properties file:

log4j.additivity.org.quartz = false
0

精彩评论

暂无评论...
验证码 换一张
取 消