Class i$.log.Logger
Class representing a Logger
Defined in: logging_layer.js.uncompressed.js.preCBT.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
A Logger object is used to log messages for a specific system or application component.
|
Class Detail
i$.log.Logger()
A Logger object is used to log messages for a specific system or application component. Loggers are
normally named, using a hierarchical dot-separated namespace. Logger names can be arbitrary strings,
but they should normally be based on the package name or class name of the logged component,
such as com.ibm.wps.component or com.ibm.wps.component.Class.
Logger objects may be obtained by calls to i$.getLogger factory methods. These will either create a new Logger or return a suitable existing Logger.
Logging messages will be forwarded to registered Handler objects, which can forward the messages to a variety of destinations, including consoles, files, OS logs, etc.
Each Logger keeps track of a "parent" Logger, which is its nearest existing ancestor in the Logger namespace. The default Enabler logging framework uses only one parent logger, the "root Logger"
On each logging call the Logger initially performs a cheap check of the request level (e.g. SEVERE or TRACE) against the effective global log level for the logger. If the request level is lower than the log level, the logging call returns immediately.
After passing this initial (cheap) test, the Logger will publish a the specified paramters to its output Handlers. By default, if the logger is not the root logger, it also publishes to it's parent's Handlers.
Most of the logger output methods take a "message" argument. This message argument may be either a raw value or a format string. During formatting, the format string will be filled in with the specified parameters. Otherwise the original message string is used. Formatting parameters: A format string "${0} ${1}" would format two parameters as strings.
A global JS object can be used to configure the loggers that are considered for tracing.
This object is named
Additional to the classes that should be logged the
Logger objects may be obtained by calls to i$.getLogger factory methods. These will either create a new Logger or return a suitable existing Logger.
Logging messages will be forwarded to registered Handler objects, which can forward the messages to a variety of destinations, including consoles, files, OS logs, etc.
Each Logger keeps track of a "parent" Logger, which is its nearest existing ancestor in the Logger namespace. The default Enabler logging framework uses only one parent logger, the "root Logger"
On each logging call the Logger initially performs a cheap check of the request level (e.g. SEVERE or TRACE) against the effective global log level for the logger. If the request level is lower than the log level, the logging call returns immediately.
After passing this initial (cheap) test, the Logger will publish a the specified paramters to its output Handlers. By default, if the logger is not the root logger, it also publishes to it's parent's Handlers.
Most of the logger output methods take a "message" argument. This message argument may be either a raw value or a format string. During formatting, the format string will be filled in with the specified parameters. Otherwise the original message string is used. Formatting parameters: A format string "${0} ${1}" would format two parameters as strings.
A global JS object can be used to configure the loggers that are considered for tracing.
This object is named
traceConfig and can be accessed through the
{@link com.ibm.mashups.enabler.services.ConfigService ConfigService} or initialized by ConfigService.properties[ "com.ibm.mashups.*", "com.ibm.mm.*" ]
Additional to the classes that should be logged the
isDebug Flag must be set to true.
Please note: For faster access this object has been made available directly on i$ as i$.Logger.