首页 > Web开发 > 详细

Understanding Apache Log4j

时间:2014-10-12 15:56:49      阅读:307      评论:0      收藏:0      [点我收藏+]

Overview of the log4j architecture:

The architecture of the log4j API is layerd. Each layer consist of different objects performing different task. 

The Top layer captures the logging information

The middle layer is involved in analyzing and authorizing the logging information

The bottom layer is responsible for formating and publishing the logging information

In essence, log4j consist of three types of primary objects:

  • Logger : is responsible for capturing the logging information
  • Appender: logging information to various prefered destinations
  • Layout: is used to format information in different styles.

Apart form them, there are several auxiliary objects that can plug and play to any layer of the API:

  • Level: there are seven levels of logging defiend within the Api:OFF,DEBUG,INFO,ERROR,WARN,FATAL and ALL.
  • Filter: is used to analyze logging information and make further decisions on wheter  that information should be logged or not
  • ObjectRender: is specialized in providing a String representation of differetn objects passed to the logging framwork.
  • LogManager: is responsible for reading and initial configuration parameters from a system-wide configuration file or a configuration class

it‘s time to discuss how they interact with each other:

bubuko.com,布布扣

Understanding Apache Log4j

原文:http://www.cnblogs.com/woodynd/p/4020590.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!