[link] logging

Java 2010. 6. 21. 14:56
Log4J 1.2 Manual
http://logging.apache.org/log4j/1.2/manual.html

Log4j delivers control over logging
http://www.javaworld.com/jw-11-2000/jw-1122-log4j.html

log4j wiki
http://wiki.apache.org/logging-log4j/

[book] The complete log4j manual
https://www.qos.ch/shop/products/eclm/

Simple Logging Facade for Java
http://www.slf4j.org/

JBoss separating application logs
http://community.jboss.org/wiki/SeparatingApplicationLogs


Log4J

components : Logger Appender Layout
Logger = Category (before version 1.2)
Logger name : "com.foo" is parent of "com.foo.bar"
Root Logger
Level : trace, debug, info, warn, error, fatal
Level Inheritance
The inherited level for a given logger C, is equal to the first non-null level in the logger hierarchy, starting at C and proceeding upwards in the hierarchy towards the root logger.

 
Basic Selection Rule
A log request of level p in a logger with (either assigned or inherited, whichever is appropriate) level q, is enabled if p >= q.


Appenders and Layouts

an output destination is called an appender.
Currently, appenders exist for the console, files, GUI components, remote socket servers, JMS, NT Event Loggers, and remote UNIX Syslog daemons.
Each enabled logging request for a given logger will be forwarded to all the appenders in that logger as well as the appenders higher in the hierarchy

 
Appender Additivity
The output of a log statement of logger C will go to all the appenders in C and its ancestors. This is the meaning of the term "appender additivity".

However, if an ancestor of logger C, say P, has the additivity flag set to false, then C's output will be directed to all the appenders in C and its ancestors upto and including P but not the appenders in any of the ancestors of P.

Loggers have their additivity flag set to true by default.





Posted by 天下太平
,