understanding apache log4j: logging information can even be distributed over jave message service or jdbc, or can be output to a tcp/ip socket. the architecture of the log4j is layered. each layer consists of different objects performing different tasks. the top layer captures the logging information, the middle layer is involved in analyzing and authorizing the logging information and the bottom layer is responsibel for formattinf and publish the logging information to a destination. in essence, log4j consists of three types of primary objects: logger is responsible for capturing logging information. appender object is responsible for publishing logging information to various preferred destinations. each appender object will have at least one target destination attached to it. layout object is used to format logging information in different styles. appender objects utilize layout objects before publishing logging information. layout objects pay an important role in publishing logging information in a way that is human readable and resuable.level object denotes the priority or severity associated with a logging message. a logger and appender can have threshold levels associated with them. logging messages get filtered according to how their levels compare to those of both the logger and appender. apache log4j provides various layout objects each of which can format logging data according to variuos latouts. the structure of logging information can vary in terms of the message content, the type of the content and the way the information is presented.but in abstract terms, all logging information can be organized into a header, body and footer. the header may present an introduction to the message; the body contains the logging information and the footer section can contain some hint about the content of the message.
log4j
最新推荐文章于 2025-12-07 09:27:54 发布
6万+

被折叠的 条评论
为什么被折叠?



