getLogger |
public Logger getLogger(String suffix, String resourceBundleName) throws java.util.MissingResourceException, javax.jbi.JBIException(Code) |
| Get a logger instance from JBI. Loggers supplied by JBI are guaranteed
to have unique names such that they avoid name collisions with loggers
from other components created using this method. The suffix parameter
allows for the creation of subloggers as needed. The JBI specification
says nothing about the exact names to be used, only that they must be
unique across components and the JBI implementation itself.
In addition to creating the logger instance, this implementation also
adds the logger instance to a list used by the ComponentLoggerMBean to
display and control of the logger level via the administrative tools.
In this implementation, the main logger always has its logger name set
to the component name, and all sub-loggers are prefixed with the
component name. This provides the ability to set the log levels for
all of a component's loggers by setting the main logger's level.
However, it is important to note that if the log level is explicitly
set for a sub-logger, that level stays in effect regardless of the main
logger's level, until the sub-logger's level is explicitly changed.
If a component does not call this method to create a main logger before
calling it to create a sub-logger, the main logger is created
automatically before the sub-logger is created.
Parameters: suffix - logger name suffix for creating subloggers; empty stringfor base logger. Parameters: resourceBundleName - name of ResourceBundle to be usedfor localizing messages for the logger. May be null if noneof the messages require localization. The resource, if non-null, must beloadable using the component's class loader as the initiating loader. a standard logger, named uniquely for this component (plus thegiven suffix, if applicable) throws: java.util.MissingResourceException - if the resourceBundleName isnon-null and no corresponding resource can be found. throws: javax.jbi.JBIException - if any other error occurs. |