默认情况下,logger的additive标志被设置为true,表示子logger将继承父logger的所有appenders。该选项可以被重新设置,表示子logger将不再继承父logger的appenders。
例如:
log4j.rootCategory=INFO, axx, file, notif
log4j.category.il.axxrpc.AxxRpcAdapter=INFO, file
上面这个例子会把AxxRpcAdapter的INFO level的log输出到file, axx, notif三个appender上, 其中axx和notif是继承自root logger的。
如果我们想只把AxxRpcAdapter的log输出到"file", 则应该把additive标志设为false。
log4j.additivity.il.axxrpc.AxxRpcAdapter=false
性能方面考虑:
如果多个线程写log到同一个文件,每个线程拿到RootCategory时会做同步(synchronized),最终会导致线程间的等待,影响性能。
如何避免:
1. 发布的产品log level要尽量设高(比如ERROR, OFF), 少打log;
2. 可以根据模块分文件打log。由于logger的继承性, 不同的appender最终都可以调用到Root Logger而做同步,从而影响性能。所以可以考虑对每个appendername设定additive=false
分享到:
相关推荐
Hastie的经典著作, 可加模型, 想快速了解可加模型以及广义可加模型直接阅读2,4,6章
additive noise channeladditive noise channeladditive noise channel
additive margin softmax for face vertification人脸识别
ANSYS,Additive,Suite增材工艺仿真解决方案.doc
Hastie的成名作,扩展的加性模型,从统计角度看待Adaboost。成书于1990年。 Hastie. Generalized Additive Models, Chapman and Hall, 1990.
Additive logistic regression-a statistical view of boosting.pdf
Android-android_additive_animations.zip,Android附加动画!,安卓系统是谷歌在2008年设计和制造的。操作系统主要写在爪哇,C和C 的核心组件。它是在linux内核之上构建的,具有安全性优势。
unity叠加场景的专用插件,场景切换实例。 unity叠加场景的专用插件,场景切换实例 unity叠加场景的专用插件,场景切换实例
a statistical view of boosting
zoj 1204 Additive equations.md
Bio Med Central Page 1 of 10 (page number not for citation purposes) Epidemiologic Perspectives & ...Interaction measured on the additive scale has been argued to be better correlated with biolo
Lecture on additive inverse of a matrix
APEX—The Additive System of Photographic Exposure
ANSYS Additive Suite ANSYS DesignerRF 增材工艺仿真 ...
使用特征学习的主要挑战之一深度卷积神经网络(DCNN)用于大规模人脸识别是适度损失的设计可以增强判别力的功能。中央损失会惩罚深层特征之间的距离他们相应的班级中心在欧几里得空间实现类内的紧凑性。...
One of the main challenges in feature learning using Deep Convolutional Neural Networks (DCNNs) for large- scale face recognition is the design of appropriate loss func- tions that enhance ...
外来植物薇甘菊入侵的凋落物混合分解效应研究,陈宝明,彭少麟,不同植物的凋落物混合后会产生混合分解效应,也称作非加和效应(non-additive effects),有的研究发现不同植物的凋落物混合后会产生正分�
考虑了模糊神经网络的学习功能,提出利用Additive2multiplicative 模糊神经网络(AMFNN) 对ATM 网络进 行拥塞控制的方案. 在拥塞控制过程中,利用AMFNN 模糊神经网络预测下一个将要到达流的特征,结合当前缓冲 ...
介绍3D打印的各项技术及其应用,非常全面的外文教材,感兴趣的朋友请自行下载!
EOS_Additive Manufacturing (Industrial 3D Printing).pdf