LOG4J
'log4j' is a Java-based logging utility. It was originally written by Ceki Gülcü and is now a project of the Apache Software Foundation. It is used primarily as a debugging tool. log4j is one of several Java Logging Frameworks
Log4j 1.2 offers six standard logging levels; from highest (coarsest) to lowest (finest):
★ FATAL
★ ERROR
★ WARN
★ INFO
★ DEBUG
★ TRACE
Also, custom logging levels can be added.
There are 2 ways to configure log4j. One is with a properties file and the other is with an XML file. Within either you can define 3 main components: Loggers, Appenders and Layouts. Configuring logging via a file has the advantage of turning logging on or off without modifying the application that uses log4j. The application can be allowed to run with logging off until there's a problem, for example, and then logging can be turned back on simply by modifying the configuration file.
'Loggers' are logical log file names. They are the names that are known to the Java application. Each logger is independently configurable as to what level of logging (FATAL, ERROR, etc) it currently logs. In early versions of log4j, these were called category and priority, but now they're called logger and level, respectively.
The actual outputs are done by 'Appenders'. There are numerous Appenders available, with descriptive names, such as FileAppender, ConsoleAppender, SocketAppender, SyslogAppender, NTEventLogAppender and even SMTPAppender. Multiple Appenders can be attached to any Logger, so it's possible to log the same information to a file locally and to a socket listener on another computer, for example.
Appenders use 'Layouts' to format log entries. A popular way to format one-line-at-a-time log files is PatternLayout, which uses a pattern string, much like the C (programming language) function printf. There are also HTMLLayout and XMLLayout formatters for use when HTML or XML formats are more convenient.
| Contents |
| External links |
| Ports |
External links
★ Official Log4j Homepage
★ Log4j Javadocs
★ Setting up a Log4j Socket Server to Email You Errors From Your Java Programs
★ LogMX: a Log4j file viewer
Ports
★ dlib C++ library Homepage - A port for C++
★ Log4cxx Homepage - apache port for C++
★ Log4cplus Homepage - Another port for C++ (outdated)
★ Log4cpp Homepage - Yet another port for C++ (outdated)
★ Log4plsql HomePage] - A port to the Oracle PL/SQL
★ Log4c - A port for C
★ Log4perl - A port for Perl
★ Log4js - A port for JavaScript
★ logging - The official logging module for Python inspired by log4j.
★ Log4r - Ruby logging module inspired by log4j
★ Log4net - A port to the Microsoft .NET Framework
★ log4php a port for PHP
★ logback a purported successor to log4j, designed by log4j's founder
★ log4sh a port for various Unix shells including sh, bash, dash and ksh
This article provided by Wikipedia. To edit the contents of this article, click here for original source.
psst.. try this: add to faves
Featured Companies
| Dancing Moon Travel | |
| Selloffvacations.com Oakville |

العربية
中国
Français
Deutsch
Ελληνική
हिन्दी
Italiano
日本語
Português
Русский
Español



