我爱编程

Pro_Apache_Log4j - CHAPTER 2 Und

2017-12-21  本文已影响23人  海德堡绝尘

Pro Apache Log4j Second Edition-CHAPTER 2 Understanding Apache log4j

['prisidɪŋ] v. 在...之前(precede的ing形式)| adj. 在前的;前述的
[ɔːɡ'zɪlɪəri] n. 助动词;辅助者,辅助物;附属机构 | adj. 辅助的;副的;附加的



• An application instantiates a named Logger instance and passes various logging information to it.
(应用程序实例化一个指定的Logger实例,并将各种日志记录信息传递给它。)

• A Logger object has a designated Level object associated with it. The Logger object provides several logging methods that are capable of logging information into categorized levels.
(Logger对象有一个与之关联的指定Level对象。 Logger对象提供了几种能够将信息记录到分类级别的日志记录方法)
['dɛzɪg,netɪd] adj. 指定的;特指的
capable of 有…能力的;可…的

• A Logger logs only the messages with Level objects equal to or greater than its assigned Level object, or else it rejects the logging request.
(记录器仅记录Level对象等于或大于其分配的Level对象的消息,否则拒绝记录请求)

• Once the Level condition has been met, the Logger object passes the logging information to all its associated Appender objects and to all the Appender objects associated with its parent Logger, recursively up the logging hierarchy.
一旦满足Level条件,Logger对象会将日志记录信息传递给其所有关联的Appender对象以及所有与其父Logger关联的Appender对象,递归地记录日志层次结构
[ri'kəsivli] adv. 递归地;递回地

• Similar to Logger objects, Appender objects can also have threshold Levels attached to them. The logging information is validated against the threshold Level attached to the Appender. If the log message has a Level equal to or greater than the threshold Level, the logging message is passed to the next stage.
(类似于Logger对象,Appender对象也可以附加阈值级别。 日志记录信息根据附加到Appender的阈值水平进行验证。 如果日志消息的Level等于或大于阈值Level,则日志消息传递到下一个阶段)

• The Appender objects then look for any Filter object associated with them. If there are any, the logging information is passed through all the Filter objects in a chain.
(Appender对象然后查找与它们关联的任何Filter对象。 如果有的话,日志记录信息通过链中的所有Filter对象传递)

• Once all the Filter objects approve a message, the Appender utilizes any Layout object associated with it to format the message, and finally it publishes the logging information to the preferred destination
(一旦所有的Filter对象批准了一条消息,Appender就利用与它相关联的任何Layout对象来格式化消息,最后它将日志信息发布到首选的destination)

Figure 2-1 depicts the overall flow of the log4j logging architecture in a UML sequence diagram (图2-1描述了UML序列图中log4j日志记录体系结构的整体流程)

image.png
上一篇下一篇

猜你喜欢

热点阅读