Differences between revisions 2 and 3
Revision 2 as of 2008-02-29 21:58:14
Size: 1117
Editor: JacobAnawalt
Comment: Mention the hiearchy-wide logger threshold filter.
Revision 3 as of 2009-09-20 23:45:56
Size: 1117
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
In log4cxx/log4j context ["Logger"] objects are the sources of logging data. Older examples or documentation may refer to the Category object. It is essentially the same thing. ["Logger"] has replaced Category. In log4cxx/log4j context [[Logger]] objects are the sources of logging data. Older examples or documentation may refer to the Category object. It is essentially the same thing. [[Logger]] has replaced Category.
Line 9: Line 9:
["Appender"]s are the data sinks. As explained in the API docs and wiki page on the topic a ["Logger"]'s source data can go to one or more sinks. [[Appender]]s are the data sinks. As explained in the API docs and wiki page on the topic a [[Logger]]'s source data can go to one or more sinks.
Line 13: Line 13:
You can ''filter'' ["Logger"] statements by changing the log level for a given logger. This turns on or off various source points for a given logger if it uses various log levels. You can override all the ["Logger"]s levels by setting the Threshold of the LoggerRepository object. ''(It is ALL by default)'' You can ''filter'' [[Logger]] statements by changing the log level for a given logger. This turns on or off various source points for a given logger if it uses various log levels. You can override all the [[Logger]]s levels by setting the Threshold of the LoggerRepository object. ''(It is ALL by default)''
Line 15: Line 15:
Once a Logger has emitted a log statement, it will be written by any ["Appender"]s attached to it unless it fails to meet their optional Filter or Threshold filters (part of AppenderSkeleton.) Once a Logger has emitted a log statement, it will be written by any [[Appender]]s attached to it unless it fails to meet their optional Filter or Threshold filters (part of AppenderSkeleton.)

If you have trouble getting your head around Loggers (ex Categories) and Appenders, perhaps it will help to think of them as sources and sinks with filtering methods available on each.

Sources

In log4cxx/log4j context Logger objects are the sources of logging data. Older examples or documentation may refer to the Category object. It is essentially the same thing. Logger has replaced Category.

Sinks

Appenders are the data sinks. As explained in the API docs and wiki page on the topic a Logger's source data can go to one or more sinks.

Filters

You can filter Logger statements by changing the log level for a given logger. This turns on or off various source points for a given logger if it uses various log levels. You can override all the Loggers levels by setting the Threshold of the LoggerRepository object. (It is ALL by default)

Once a Logger has emitted a log statement, it will be written by any Appenders attached to it unless it fails to meet their optional Filter or Threshold filters (part of AppenderSkeleton.)

SourcesSinksAndFilters (last edited 2009-09-20 23:45:56 by localhost)