Log4j 總結(一) log4j特色

One of the distinctive features of log4j is the notion of inheritance in loggers. Using a logger hierarchy it is possible to control which log statements are output at arbitrarily fine granularity but also great ease. This helps reduce the volume of logged output and minimize the cost of logging.

 

log4j一個出彩的特點是引入loggers繼承的概念,使用logger繼承可以更好控制日誌輸出的粒度,更加易用。有效的減少了日誌輸出的數量並且使記錄日誌減至最小的代價。

 

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. Actual logging is also quite fast, ranging from 21 microseconds using the SimpleLayout, 37 microseconds using the TTCCLayout. The performance of the PatternLayout is almost as good as the dedicated layouts, except that it is much more flexible.

 

在AMD主頻爲800MHz的毒龍處理器運行JDK1.3.1 ,log4j花費約5納秒來確定是否應該記錄日誌。實際日誌記錄也十分迅速,使用SimpleLayout(日誌佈局)需要21微秒 , 使用TTCCLayout(日誌佈局)需要37微秒 。PatternLayout(日誌佈局)的表現非常專業,但它是靈活得多。

發佈了27 篇原創文章 · 獲贊 0 · 訪問量 1969
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章