博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
log4j
阅读量:5946 次
发布时间:2019-06-19

本文共 1691 字,大约阅读时间需要 5 分钟。

http://logging.apache.org/log4j/1.2/

Why logging?

Inserting log statements into your code is a low-tech method for debugging it. It may also be the only way because debuggers are not always available or applicable. This is often the case for distributed applications.

插入日志语句到你的代码中是调试代码的一种基本方法。当不能或不适合使用调试器时,这可能是唯一的一种方法。
On the other hand, some people argue that log statements pollute source code and decrease legibility. (We believe that the contrary is true).
另一方面,一些人争论日志语句污染了源代码和降低了易读性。(我们相信反面是真的)
In the Java language where a preprocessor is not available, log statements increase the size of the code and reduce its speed, even when logging is turned off.
在java里预处理器是不可用的,日志语句增加了代码的大小降低了速度,即使日志被关闭。
Given that a reasonably sized application may contain thousands of log statements, speed is of particular importance.
如果大小适当的应用程序可能包含有大量的日志语句,这时速度尤为重要。

 

Performance

性能
On an AMD Duron clocked at 800Mhz running JDK 1.3.1, it costs about 5 nanoseconds to determine if a logging statement should be logged or not.
在运行JDK 1.3.1,主频800Mhz的AMD 毒龙环境下,花费5纳秒来检测一个日志语句应该记录还是不记录。
Actual logging is also quite fast, ranging from 21 microseconds using the SimpleLayout, 37 microseconds using the TTCCLayout.
实际记录是非常快的,范围从使用简单布局的21毫秒,使用TTCCLayout的37毫秒。
The performance of the PatternLayout is almost as good as the dedicated layouts, except that it is much more flexible.
PatternLayout的性能几乎和专用的布局一样好,只是它更加灵活。

Roadmap

路线图
The package is being constantly improved thanks to input from users and code contributed by authors in the community.
包的持续改进要感谢社区中来自用户的输入和作者的代码贡献。
Please note, the team is currently working on log4j 2 which will replace log4j 1 in near future.
请注意,团队现在工作在不久的未来将替换log4j 1 的log4j 2下。

转载地址:http://cibxx.baihongyu.com/

你可能感兴趣的文章
工作流引擎Oozie(一):workflow
查看>>
struct框架
查看>>
Deep Learning(深度学习)相关网站
查看>>
设置Eclipse编码方式
查看>>
分布式系统唯一ID生成方案汇总【转】
查看>>
并查集hdu1232
查看>>
oracle进行字符串拆分并组成数组
查看>>
100多个基础常用JS函数和语法集合大全
查看>>
Java8 lambda表达式10个示例
查看>>
innerHTML outerHTML innerText
查看>>
kafka安装教程
查看>>
go语言基础
查看>>
【Windows】字符串处理
查看>>
Spring(十八):Spring AOP(二):通知(前置、后置、返回、异常、环绕)
查看>>
CentOS使用chkconfig增加开机服务提示service xxx does not support chkconfig的问题解决
查看>>
微服务+:服务契约治理
查看>>
save
查看>>
Android DrawLayout + ListView 的使用(一)
查看>>
clear session on close of browser jsp
查看>>
关于吃掉物理的二次聚合无法实现的需要之旁门左道实现法
查看>>