Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Aphorismen
Applications
Business Economics & Admin.
My Computers
Cooking
Devices
Folders
Food
Hardware
Infos
Software Development
Sports
Operation Instructions
Todos
Test
Help
Glossary
Community portal
adaptions
Sidebar anpassen
Wiki RB4
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Log4j
Page
Discussion
English
Read
Edit
View history
Toolbox
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=Concepts= Log4j has teh following fundamental objects: * logger * categories, * [[#Priority|priorities (levels)]], * appenders and * layouts. ==Logger/Category== Loggers are named entities and sub classes of category. Logger names are case-sensitive and they follow the hierarchical naming rule. A logger is said to be an ancestor of another logger if its name followed by a dot is a prefix of the descendant logger name. Eine Referenz auf die Instanz des Root-Loggers kann mit der statischen Funktion Logger.getLooger("<NAME>"); geholt werden. The '''root logger''' resides at the top of the logger hierarchy. It is exceptional in two ways: #it always exists, #it cannot be retrieved by name, but by Logger.getRootLogger(). ==Priority== Loggers may be assigned levels. The set of possible levels, that is: * TRACE * DEBUG * INFO * WARN * ERROR * FATAL 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. For the standard levels, we have DEBUG < INFO < WARN < ERROR < FATAL. ==Layout== The layout is defined in a pattern prefixed by % and a following letter code: * c: category * C: class name * d{<Format>}: date e.g. %d{HH:mm:ss,SSS} * E: exception stack * F: file name * l: location * L: line number * m: message * M: method name * p: log level (ERR, INFO, ...) * s: message * t: name of the thread ==Logging== Das Loggen von Meldungen erfolgt über so genannte "Printing-Methods". Folgende Methoden sind verfügbar: logger.[debug()|info()|warn()|error()fatal()|log()|trace()]; =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
Summary:
Please note that all contributions to Wiki RB4 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Uwe Heuer Wiki New:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width