首页 > 编程知识 正文

log4j additivity属性,log4j additivity 作用

时间:2023-05-05 16:10:57 阅读:184962 作者:2571

log4j的additivity属性值默认是设置为true的。可参考其api,地址:http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Category.html#setAdditivityboolean。

描述:Additivity is set to true by default, that is children inherit the appenders of their ancestors by default. If this variable is set to false then the appenders found in the ancestors of this category are not used. However, the children of this category will inherit its appenders, unless the children have their additivity flag set to false too. See the user manual for more details.


默认为true时,就会产生冗余日志。所以只要设置为false,就可以去除冗余了。
 

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。