码迷,mamicode.com
首页 > Web开发 > 详细

Understanding Apache Log4j

时间:2014-10-12 17:05:38      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   http   io   ar   for   sp   2014   

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

标签:des   style   blog   http   io   ar   for   sp   2014   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!