Log4j: Difference between revisions

From Wiki RB4
Line 1: Line 1:
=Concepts=
=Concepts=
Log4j has four fundamental objects: categories, priorities, appenders and layouts.
Log4j has four fundamental objects: categories, priorities (levels), appenders and layouts.


==Category==
==Category==
Line 6: Line 6:


==Priority==
==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.
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=
=Configuration=

Revision as of 10:49, 4 January 2010

Concepts

Log4j has four fundamental objects: categories, priorities (levels), appenders and layouts.

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.

Logging Level are:

  • ALL
  • DEBUG
  • ERROR
  • FATAL
  • INFO
  • OFF
  • TRACE
  • WARN