NonStop Servlets for JavaServer Pages (NSJSP) 6.1 System Administrator's Guide

Logging in NSJSP
NonStop Servlets for JavaServer Pages (NSJSP) 6.1 System Administrator’s Guide596210-006
5-2
Handlers
Additionally, com.foo.bar1 and com.foo.bar2 are also child loggers of com.foo,
and are peer loggers of com.foo.bar.
Each log message is associated with a log level, which denotes the severity of the log.
Similar to the log messages, a logger is associated with a log level. If no log level is
associated with a logger, the logger inherits the log level from its nearest parent that is
associated with a log level.
Each logger can be configured with a set of handlers. Based on the level of the log
message that a logger receives and its own log level, the logger either forwards the
message to the associated set of handlers for further processing, or it discards the log
message. The logger can also send messages to its parent logger. The parent logger
writes log records to its handlers and to all its parent loggers in the tree. By default, this
option is disabled. However, you can enable the option by using the
useParentHandler configuration property of the logger.
Handlers
A handler receives the log message forwarded by the logger. Based on the log level of
the log message and its own log level, the handler either discards the log message or it
publishes the log message to a variety of destinations. NSJSP provides handlers that
can publish messages to destinations, such as, Event Management Service (EMS),
STDOUT, and STDERR.
The Java logging package defines a set of handlers.
Table 5-1 lists the handlers defined in the Java logging package.
You can configure each handler using the configuration properties that are specific to
the handler.
Formatters
A formatter defines the format of log messages. Every handler is associated with a
formatter. The Java logging package defines two formatters: SimpleFormatter and
XMLFormatter.
Table 5-1. Handlers in the Java Logging Package
Handler Description
ConsoleHandler Publishes log messages to system.err.
FileHandler Publishes log messages to a file.
MemoryHandler Publishes logs to a circular buffer in memory.
StreamHandler Publishes logs to a stream.
SocketHandler Publishes logs to a TCP/IP socket.