Java logging framework: Difference between revisions

Content deleted Content added
M0smith (talk | contribs)
M0smith (talk | contribs)
Line 6:
Most frameworks support a the notion of a Logger. A Logger is an object that allows the application to log data without regard to where the data is actually logged. The application logs a message in the form of an object or and object and and exception. When a Logger is created, it is given a name or an identifier. When logging a message, it is logged at a certain level or priority.
====Name====
A logger has a name. The name is usually hierarchical, with periods (.) separating the levels. A common naming scheme is to use the name of the class or package that is doing the loggings. Both log4j and the Java API supported defining Handlers higher up the hierarchy.
 
For example, the logger might be named "com.sun.some.UsefulClass". The handler can be define for any of the following:
com
com.sun
com.sun.some
com.sun.some.UsefulClass
 
====Level====
The message is logged at a certain level. The common levels are, copied from [http://jakarta.apache.org/commons/logging/guide.html#Message_Priorities_Levels Jakarta Commons Logging]: