Log4j - Log only specified method to file
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
精彩评论