首页 > 代码库 > Understanding Apache Log4j
Understanding Apache Log4j
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:
Understanding Apache Log4j
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。