Log4j: Difference between revisions
| Line 3: | Line 3: | ||
* logger | * logger | ||
* categories, | * categories, | ||
* [#Priority|priorities (levels)], | * [[#Priority|priorities (levels)]], | ||
* appenders and | * appenders and | ||
* layouts. | * layouts. | ||
Revision as of 21:48, 26 January 2012
Concepts
Log4j has teh following fundamental objects:
- logger
- categories,
- priorities (levels),
- appenders and
- layouts.
==Logger
Category
A category is a like java named entity. There exists a special root category that simply is, but has no name.
Priority
Priority objects have both a string name and an integer value. The name is simply a mnemonic label for the priority. The integer value defines a relative order amongst priorities. The Level class extends the Priority class to be conform with java.util.logging.
Configuration
Properties can be defined by a properties file or by an XML file. The xml configuration class offers more flexibility and the benefits, and drawbacks, of an XML based configuration.
Logging Level are:
- ALL
- DEBUG
- ERROR
- FATAL
- INFO
- OFF
- TRACE
- WARN