|
|
Basic features of any logging library
are:
1. Control over which logging statements
are enabled or disabled - the Logger,
the central class in the log4j package.
2. Manage output destinations - Appenders,
there are appenders for files, the
console, Unix Syslog, NT Event Log,
remote servers, SMTP e-mail, etc.
3.Manage output format- Layouts,
the most popular layouts are the PatternLayout
and HTMLLayout.
As mentioned above Log4j has three
main components: loggers, appenders and layouts.
1. public class Logger-
Logger is responsible for handling
the majority of log operations.
2. public interface Appender - Appender is responsible for controlling
the output of log operations.
3. public abstract class
Layout-Layout is responsible
for formatting the output for Appender.
These three types of components work
together to enable developers to log
messages according to message type
and level, and to control at runtime
how these messages are formatted and
where they are reported.
|
|