Logger class. Note that this implementation does
not use the java.util.logging.Handler class. Instead, logging is delegated to the
underlying Log4j org.apache.logging.log4j.Logger which may be implemented in one of many different ways.
Consult the documentation for your Log4j Provider for more details.
Note that the methods getParent() and setLevel(java. are not supported by
this implementation. If you need support for these methods, then you'll need to use log4j-core. The
getParent() method will not fail (thanks to JUL API limitations), but it won't necessarily be
accurate!
Also note that setParent(java. is explicitly unsupported. Parent loggers are
determined using the syntax of the logger name; not through an arbitrary graph of loggers.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private final WrappedLogger |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | config(final String
The string message (or a key in the message catalog) msg)Overrides java. Log a CONFIG message. |
| protected void | |
| public void | entering(final String
name of class that issued the logging request sourceClass, final String name of method that is being entered sourceMethod)Overrides java. Log a method entry. |
| public void | entering(final String
name of class that issued the logging request sourceClass, final String name of method that is being entered sourceMethod, final Object parameter to the method being entered param1)Overrides java. Log a method entry, with one parameter. |
| public void | entering(final String
name of class that issued the logging request sourceClass, final String name of method that is being entered sourceMethod, final Object[] array of parameters to the method being entered params)Overrides java. Log a method entry, with an array of parameters. |
| public void | exiting(final String
name of class that issued the logging request sourceClass, final String name of the method sourceMethod)Overrides java. Log a method return. |
| public void | exiting(final String
name of class that issued the logging request sourceClass, final String name of the method sourceMethod, final Object Object that is being returned result)Overrides java. Log a method return, with result object. |
| public void | fine(final String
The string message (or a key in the message catalog) msg)Overrides java. Log a FINE message. |
| public void | finer(final String
The string message (or a key in the message catalog) msg)Overrides java. Log a FINER message. |
| public void | finest(final String
The string message (or a key in the message catalog) msg)Overrides java. Log a FINEST message. |
| public String | |
| public void | info(final String
The string message (or a key in the message catalog) msg)Overrides java. Log an INFO message. |
| pack-priv boolean | |
| public boolean | isLoggable(final Level
a message logging level level)Overrides java. Check if a message of the given level would actually be logged by this logger. |
| public void | log(final LogRecord
the LogRecord to be published record)Overrides java. Log a LogRecord. |
| public void | log(final Level
One of the message level identifiers, e.g., SEVERE level, final String The string message (or a key in the message catalog) msg)Overrides java. Log a message, with no arguments. |
| public void | log(final Level
One of the message level identifiers, e.g., SEVERE level, final String The string message (or a key in the message catalog) msg, final Object parameter to the message param1)Overrides java. Log a message, with one object parameter. |
| public void | log(final Level
One of the message level identifiers, e.g., SEVERE level, final String The string message (or a key in the message catalog) msg, final Object[] array of parameters to the message params)Overrides java. Log a message, with an array of object arguments. |
| public void | log(final Level
One of the message level identifiers, e.g., SEVERE level, final String The string message (or a key in the message catalog) msg, final Throwable Throwable associated with log message. thrown)Overrides java. Log a message, with associated Throwable information. |
| public void | logp(final Level
One of the message level identifiers, e.g., SEVERE level, final String name of class that issued the logging request sourceClass, final String name of method that issued the logging request sourceMethod, final String The string message (or a key in the message catalog) msg)Overrides java. Log a message, specifying source class and method, with no arguments. |
| public void | logp(final Level
One of the message level identifiers, e.g., SEVERE level, final String name of class that issued the logging request sourceClass, final String name of method that issued the logging request sourceMethod, final String The string message (or a key in the message catalog) msg, final Object Parameter to the log message. param1)Overrides java. Log a message, specifying source class and method, with a single object parameter to the log message. |
| public void | logp(final Level
One of the message level identifiers, e.g., SEVERE level, final String name of class that issued the logging request sourceClass, final String name of method that issued the logging request sourceMethod, final String The string message (or a key in the message catalog) msg, final Object[] Array of parameters to the message params)Overrides java. Log a message, specifying source class and method, with an array of object arguments. |
| public void | logp(final Level
One of the message level identifiers, e.g., SEVERE level, final String name of class that issued the logging request sourceClass, final String name of method that issued the logging request sourceMethod, final String The string message (or a key in the message catalog) msg, final Throwable Throwable associated with log message. thrown)Overrides java. Log a message, specifying source class and method, with associated Throwable information. |
| public void | logrb(final Level
One of the message level identifiers, e.g., SEVERE level, final String name of class that issued the logging request sourceClass, final String name of method that issued the logging request sourceMethod, final String name of resource bundle to localize msg,
can be null bundleName, final String The string message (or a key in the message catalog) msg)Overrides java. Log a message, specifying source class, method, and resource bundle name with no arguments. |
| public void | logrb(final Level
One of the message level identifiers, e.g., SEVERE level, final String name of class that issued the logging request sourceClass, final String name of method that issued the logging request sourceMethod, final String name of resource bundle to localize msg,
can be null bundleName, final String The string message (or a key in the message catalog) msg, final Object Parameter to the log message. param1)Overrides java. Log a message, specifying source class, method, and resource bundle name, with a single object parameter to the log message. |
| public void | logrb(final Level
One of the message level identifiers, e.g., SEVERE level, final String name of class that issued the logging request sourceClass, final String name of method that issued the logging request sourceMethod, final String name of resource bundle to localize msg,
can be null. bundleName, final String The string message (or a key in the message catalog) msg, final Object[] Array of parameters to the message params)Overrides java. Log a message, specifying source class, method, and resource bundle name, with an array of object arguments. |
| public void | logrb(final Level
One of the message level identifiers, e.g., SEVERE level, final String name of class that issued the logging request sourceClass, final String name of method that issued the logging request sourceMethod, final String name of resource bundle to localize msg,
can be null bundleName, final String The string message (or a key in the message catalog) msg, final Throwable Throwable associated with log message. thrown)Overrides java. Log a message, specifying source class, method, and resource bundle name, with associated Throwable information. |
| public void | setLevel(final Level
the new value for the log level (may be null) newLevel)Overrides java. Set the log level specifying which message levels will be logged by this logger. |
| public void | setParent(final Logger
the new parent logger parent)Overrides java. Unsupported operation. |
| public void | severe(final String
The string message (or a key in the message catalog) msg)Overrides java. Log a SEVERE message. |
| public void | throwing(final String
name of class that issued the logging request sourceClass, final String name of the method. sourceMethod, final Throwable The Throwable that is being thrown. thrown)Overrides java. Log throwing an exception. |
| public void | warning(final String
The string message (or a key in the message catalog) msg)Overrides java. Log a WARNING message. |
| FQCN | back to summary |
|---|---|
| private static final String FQCN | |
| logger | back to summary |
|---|---|
| private final WrappedLogger logger | |
| ApiLogger | back to summary |
|---|---|
| pack-priv ApiLogger(final ExtendedLogger logger) | |
| config | back to summary |
|---|---|
| public void config(final String msg) Overrides java. Doc from java. Log a CONFIG message. If the logger is currently enabled for the CONFIG message level then the given message is forwarded to all the registered output Handler objects. | |
| doSetLevel | back to summary |
|---|---|
| protected void doSetLevel(final Level newLevel) throws SecurityException Provides access to | |
| entering | back to summary |
|---|---|
| public void entering(final String sourceClass, final String sourceMethod) Overrides java. Doc from java. Log a method entry. This is a convenience method that can be used to log entry to a method. A LogRecord with message "ENTRY", log level FINER, and the given sourceMethod and sourceClass is logged. | |
| entering | back to summary |
|---|---|
| public void entering(final String sourceClass, final String sourceMethod, final Object param1) Overrides java. Doc from java. Log a method entry, with one parameter. This is a convenience method that can be used to log entry to a method. A LogRecord with message "ENTRY {0}", log level FINER, and the given sourceMethod, sourceClass, and parameter is logged. | |
| entering | back to summary |
|---|---|
| public void entering(final String sourceClass, final String sourceMethod, final Object[] params) Overrides java. Doc from java. Log a method entry, with an array of parameters. This is a convenience method that can be used to log entry to a method. A LogRecord with message "ENTRY" (followed by a format {N} indicator for each entry in the parameter array), log level FINER, and the given sourceMethod, sourceClass, and parameters is logged. | |
| exiting | back to summary |
|---|---|
| public void exiting(final String sourceClass, final String sourceMethod) Overrides java. Doc from java. Log a method return. This is a convenience method that can be used to log returning from a method. A LogRecord with message "RETURN", log level FINER, and the given sourceMethod and sourceClass is logged. | |
| exiting | back to summary |
|---|---|
| public void exiting(final String sourceClass, final String sourceMethod, final Object result) Overrides java. Doc from java. Log a method return, with result object. This is a convenience method that can be used to log returning from a method. A LogRecord with message "RETURN {0}", log level FINER, and the gives sourceMethod, sourceClass, and result object is logged. | |
| fine | back to summary |
|---|---|
| public void fine(final String msg) Overrides java. Doc from java. Log a FINE message. If the logger is currently enabled for the FINE message level then the given message is forwarded to all the registered output Handler objects. | |
| finer | back to summary |
|---|---|
| public void finer(final String msg) Overrides java. Doc from java. Log a FINER message. If the logger is currently enabled for the FINER message level then the given message is forwarded to all the registered output Handler objects. | |
| finest | back to summary |
|---|---|
| public void finest(final String msg) Overrides java. Doc from java. Log a FINEST message. If the logger is currently enabled for the FINEST message level then the given message is forwarded to all the registered output Handler objects. | |
| getName | back to summary |
|---|---|
| public String getName() Overrides java. Doc from java. Get the name for this logger. | |
| info | back to summary |
|---|---|
| public void info(final String msg) Overrides java. Doc from java. Log an INFO message. If the logger is currently enabled for the INFO message level then the given message is forwarded to all the registered output Handler objects. | |
| isFiltered | back to summary |
|---|---|
| pack-priv boolean isFiltered(final LogRecord logRecord) | |
| isLoggable | back to summary |
|---|---|
| public boolean isLoggable(final Level level) Overrides java. Doc from java. Check if a message of the given level would actually be logged by this logger. This check is based on the Loggers effective level, which may be inherited from its parent. | |
| log | back to summary |
|---|---|
| public void log(final LogRecord record) Overrides java. Doc from java. Log a LogRecord. All the other logging methods in this class call through this method to actually perform any logging. Subclasses can override this single method to capture all log activity. | |
| log | back to summary |
|---|---|
| public void log(final Level level, final String msg) Overrides java. Doc from java. Log a message, with no arguments. If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects. | |
| log | back to summary |
|---|---|
| public void log(final Level level, final String msg, final Object param1) Overrides java. Doc from java. Log a message, with one object parameter. If the logger is currently enabled for the given message level then a corresponding LogRecord is created and forwarded to all the registered output Handler objects. | |
| log | back to summary |
|---|---|
| public void log(final Level level, final String msg, final Object[] params) Overrides java. Doc from java. Log a message, with an array of object arguments. If the logger is currently enabled for the given message level then a corresponding LogRecord is created and forwarded to all the registered output Handler objects. | |
| log | back to summary |
|---|---|
| public void log(final Level level, final String msg, final Throwable thrown) Overrides java. Doc from java. Log a message, with associated Throwable information. If the logger is currently enabled for the given message level then the given arguments are stored in a LogRecord which is forwarded to all registered output handlers. Note that the thrown argument is stored in the LogRecord thrown property, rather than the LogRecord parameters property. Thus it is processed specially by output Formatters and is not treated as a formatting parameter to the LogRecord message property. | |
| logp | back to summary |
|---|---|
| public void logp(final Level level, final String sourceClass, final String sourceMethod, final String msg) Overrides java. Doc from java. Log a message, specifying source class and method, with no arguments. If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects. | |
| logp | back to summary |
|---|---|
| public void logp(final Level level, final String sourceClass, final String sourceMethod, final String msg, final Object param1) Overrides java. Doc from java. Log a message, specifying source class and method, with a single object parameter to the log message. If the logger is currently enabled for the given message level then a corresponding LogRecord is created and forwarded to all the registered output Handler objects.
| |
| logp | back to summary |
|---|---|
| public void logp(final Level level, final String sourceClass, final String sourceMethod, final String msg, final Object[] params) Overrides java. Doc from java. Log a message, specifying source class and method, with an array of object arguments. If the logger is currently enabled for the given message level then a corresponding LogRecord is created and forwarded to all the registered output Handler objects.
| |
| logp | back to summary |
|---|---|
| public void logp(final Level level, final String sourceClass, final String sourceMethod, final String msg, final Throwable thrown) Overrides java. Doc from java. Log a message, specifying source class and method, with associated Throwable information. If the logger is currently enabled for the given message level then the given arguments are stored in a LogRecord which is forwarded to all registered output handlers. Note that the thrown argument is stored in the LogRecord thrown property, rather than the LogRecord parameters property. Thus it is processed specially by output Formatters and is not treated as a formatting parameter to the LogRecord message property.
| |
| logrb | back to summary |
|---|---|
| public void logrb(final Level level, final String sourceClass, final String sourceMethod, final String bundleName, final String msg) Overrides java. Doc from java. Log a message, specifying source class, method, and resource bundle name with no arguments. If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects. The msg string is localized using the named resource bundle. If the resource bundle name is null, or an empty String or invalid then the msg string is not localized.
| |
| logrb | back to summary |
|---|---|
| public void logrb(final Level level, final String sourceClass, final String sourceMethod, final String bundleName, final String msg, final Object param1) Overrides java. Doc from java. Log a message, specifying source class, method, and resource bundle name, with a single object parameter to the log message. If the logger is currently enabled for the given message level then a corresponding LogRecord is created and forwarded to all the registered output Handler objects. The msg string is localized using the named resource bundle. If the resource bundle name is null, or an empty String or invalid then the msg string is not localized.
| |
| logrb | back to summary |
|---|---|
| public void logrb(final Level level, final String sourceClass, final String sourceMethod, final String bundleName, final String msg, final Object[] params) Overrides java. Doc from java. Log a message, specifying source class, method, and resource bundle name, with an array of object arguments. If the logger is currently enabled for the given message level then a corresponding LogRecord is created and forwarded to all the registered output Handler objects. The msg string is localized using the named resource bundle. If the resource bundle name is null, or an empty String or invalid then the msg string is not localized.
| |
| logrb | back to summary |
|---|---|
| public void logrb(final Level level, final String sourceClass, final String sourceMethod, final String bundleName, final String msg, final Throwable thrown) Overrides java. Doc from java. Log a message, specifying source class, method, and resource bundle name, with associated Throwable information. If the logger is currently enabled for the given message level then the given arguments are stored in a LogRecord which is forwarded to all registered output handlers. The msg string is localized using the named resource bundle. If the resource bundle name is null, or an empty String or invalid then the msg string is not localized. Note that the thrown argument is stored in the LogRecord thrown property, rather than the LogRecord parameters property. Thus it is processed specially by output Formatters and is not treated as a formatting parameter to the LogRecord message property.
| |
| setLevel | back to summary |
|---|---|
| public void setLevel(final Level newLevel) throws SecurityException Overrides java. Doc from java. Set the log level specifying which message levels will be logged by this logger. Message levels lower than this value will be discarded. The level value Level.OFF can be used to turn off logging. If the new level is null, it means that this node should inherit its level from its nearest ancestor with a specific (non-null) level value.
| |
| setParent | back to summary |
|---|---|
| public void setParent(final Logger parent) Overrides java. Unsupported operation.
| |
| severe | back to summary |
|---|---|
| public void severe(final String msg) Overrides java. Doc from java. Log a SEVERE message. If the logger is currently enabled for the SEVERE message level then the given message is forwarded to all the registered output Handler objects. | |
| throwing | back to summary |
|---|---|
| public void throwing(final String sourceClass, final String sourceMethod, final Throwable thrown) Overrides java. Doc from java. Log throwing an exception. This is a convenience method to log that a method is terminating by throwing an exception. The logging is done using the FINER level. If the logger is currently enabled for the given message level then the given arguments are stored in a LogRecord which is forwarded to all registered output handlers. The LogRecord's message is set to "THROW". Note that the thrown argument is stored in the LogRecord thrown property, rather than the LogRecord parameters property. Thus it is processed specially by output Formatters and is not treated as a formatting parameter to the LogRecord message property. | |
| warning | back to summary |
|---|---|
| public void warning(final String msg) Overrides java. Doc from java. Log a WARNING message. If the logger is currently enabled for the WARNING message level then the given message is forwarded to all the registered output Handler objects. | |