|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.sap.tc.loggingStandard.Logger
This class is similar to java.util.logging.Logger, that
contains a subset of method calls that are mainly for writing log
messages.
All the methods that supports the output of a log messages are available,
including the check for resource bundle for translation, and the
additional check if message is loggable or not.
Other configuration, such as assigning handler, filter is not mapped. And
concept of global handlers is not supported in the API, but is made
possible through the configuration file.
Note that the output API is based on the JDK1.4 beta 2 version.
| Method Summary | |
void |
config(java.lang.String msg)
Log a CONFIG message. |
void |
entering(java.lang.String sourceClass,
java.lang.String sourceMethod)
Log a method entry. |
void |
entering(java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.Object param1)
Log a method entry, with one parameter This is a convenience method that can be used to log entry to a method. |
void |
entering(java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.Object[] params)
Log a method entry, with an array of parameters. |
void |
exiting(java.lang.String sourceClass,
java.lang.String sourceMethod)
Log a method return. |
void |
exiting(java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.Object result)
Log a method return, with result object. |
void |
fine(java.lang.String msg)
Log a FINE message. |
void |
finer(java.lang.String msg)
Log a FINER message. |
void |
finest(java.lang.String msg)
Log a FINEST message. |
Level |
getLevel()
Get the log level specifying which messages will be logged by this logger. |
static Logger |
getLogger(java.lang.String name)
Find or create a logger for a named subsystem. |
static Logger |
getLogger(java.lang.String name,
java.lang.String resourceBundleName)
Find or create a logger for a named subsystem. |
java.lang.String |
getName()
Get the name for this logger. |
java.util.ResourceBundle |
getResourceBundle()
Retrieve the localization resource bundle for this logger. |
java.lang.String |
getResourceBundleName()
Retrieve the localization resource bundle name for this logger. |
void |
info(java.lang.String msg)
Log a INFO message. |
boolean |
isLoggable(Level level)
Check if a message of the given level would actually be logged by this logger, in terms of level comparison. |
void |
log(Level level,
java.lang.String msg)
Log a message, with no arguments. |
void |
log(Level level,
java.lang.String msg,
java.lang.Object param1)
Log a message, with no arguments. |
void |
log(Level level,
java.lang.String msg,
java.lang.Object[] params)
Log a message, with an array of object arguments. |
void |
log(Level level,
java.lang.String msg,
java.lang.Throwable thrown)
Log a message, with associated Throwable information. |
void |
logp(Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String msg)
Log a message, specifying source class and method, with no arguments. |
void |
logp(Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String msg,
java.lang.Object param1)
Log a message, specifying source class and method, with a single object parameter to the log message. |
void |
logp(Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String msg,
java.lang.Object[] params)
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 the given message is forwarded to all the registered output Handler objects. |
void |
logp(Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String msg,
java.lang.Throwable thrown)
Log a message, specifying source class and method, with associated Throwable information. |
void |
logrb(Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String bundleName,
java.lang.String msg)
Log a message, specifying source class, method, and resource bundle name with no arguments. |
void |
logrb(Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String bundleName,
java.lang.String msg,
java.lang.Object param1)
Log a message, specifying source class, method, and resource bundle name with a single object parameter to the log message. |
void |
logrb(Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String bundleName,
java.lang.String msg,
java.lang.Object[] params)
Log a message, specifying source class, method, and resource bundle name with an array of object arguments. |
void |
logrb(Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String bundleName,
java.lang.String msg,
java.lang.Throwable thrown)
Log a message, specifying source class, method, and resource bundle name with associated Throwable information. |
void |
setLevel(Level newLevel)
Set the log level specifying which message levels will be logged by this logger (not affecting children). |
void |
severe(java.lang.String msg)
Log a SEVERE message. |
void |
throwing(java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.Throwable thrown)
Log throwing an exception. |
void |
warning(java.lang.String msg)
Log a WARNING message. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static Logger getLogger(java.lang.String name)
If a new logger is created its log level will be configured based on the LogManager info. It will be registered in the LogManager global namespace. This will mean it will be affected by subsequent LogManager.setLevel calls.
name - A name for the logger. This should
be a dot-separated name and should normally
be based on the package name or class name
of the subsystem, such as java.net
or javax.swing. No empty Logger name allowed, as
root is always there.
public static Logger getLogger(java.lang.String name,
java.lang.String resourceBundleName)
If a new logger is created its log level will be configured based on the LogManager. It will be registered in the LogManager global namespace. This will mean it will be affected by subsequent LogManager.setLevel calls.
If the named Logger already exists and does not yet have a localization resource bundle then the given resource bundle name is used. If the named Logger already exists and has a different resource bundle name then an IllegalArgumentException is thrown.
name - A name for the logger. This should
be a dot-separated name and should normally
be based on the package name or class name
of the subsystem, such as java.net
or javax.swing.No empty string allowed, as
root is always there.resourceBundleName - name of ResourceBundle to be used for localizing
messages for this logger.java.util.MissingResourceException - if the named ResourceBundle cannot be found.IllegalArgumentName - if the Logger already exists and uses
a different resource bundle name.
public void setLevel(Level newLevel)
throws java.lang.SecurityException
newLevel - the new value for the log leveljava.lang.SecurityException - if a security manager exists and if
the caller does not have LoggingPermission("control").public Level getLevel()
public java.lang.String getName()
public java.lang.String getResourceBundleName()
public java.util.ResourceBundle getResourceBundle()
public boolean isLoggable(Level level)
level - a message logging levelpublic void config(java.lang.String msg)
If the logger is currently enabled for the CONFIG message level then the given message is forwarded to all the registered output Handler objects.
msg - The string message (or a key in the message catalog)public void fine(java.lang.String msg)
If the logger is currently enabled for the FINE message level then the given message is forwarded to all the registered output Handler objects.
msg - The string message (or a key in the message catalog)public void finer(java.lang.String msg)
If the logger is currently enabled for the FINER message level then the given message is forwarded to all the registered output Handler objects.
msg - The string message (or a key in the message catalog)public void finest(java.lang.String msg)
If the logger is currently enabled for the FINEST message level then the given message is forwarded to all the registered output Handler objects.
msg - The string message (or a key in the message catalog)public void info(java.lang.String msg)
If the logger is currently enabled for the INFO message level then the given message is forwarded to all the registered output Handler objects.
msg - The string message (or a key in the message catalog)public void severe(java.lang.String msg)
If the logger is currently enabled for the SEVERE message level then the given message is forwarded to all the registered output Handler objects.
msg - The string message (or a key in the message catalog)public void warning(java.lang.String msg)
If the logger is currently enabled for the WARNING message level then the given message is forwarded to all the registered output Handler objects.
msg - The string message (or a key in the message catalog)
public void log(Level level,
java.lang.String msg)
If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects.
level - One of the message level identifiers, e.g. SEVEREmsg - The string message (or a key in the message catalog)
public void log(Level level,
java.lang.String msg,
java.lang.Object param1)
If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects.
level - One of the message level identifiers, e.g. SEVEREmsg - The string message (or a key in the message catalog)param1 - parameter to the message
public void log(Level level,
java.lang.String msg,
java.lang.Object[] params)
If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects.
level - One of the message level identifiers, e.g. SEVEREmsg - The string message (or a key in the message catalog)params - array of parameters to the message
public void log(Level level,
java.lang.String msg,
java.lang.Throwable thrown)
If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects. Note (SAP wrapper): that the thrown argument is stored in the LogRecord parameters property.
level - One of the message level identifiers, e.g. SEVEREmsg - The string message (or a key in the message catalog)params - array of parameters to the message
public void logp(Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String msg)
If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects.
level - One of the message level identifiers, e.g. SEVEREsourceClass - name of class that issued the logging requestsourceMethod - name of method that issued the logging requestmsg - The string message (or a key in the message catalog)
public void logp(Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String msg,
java.lang.Object param1)
If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects.
level - One of the message level identifiers, e.g. SEVEREsourceClass - name of class that issued the logging requestsourceMethod - name of method that issued the logging requestmsg - The string message (or a key in the message catalog)param1 - Parameter to the log message
public void logp(Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String msg,
java.lang.Object[] params)
If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects.
level - One of the message level identifiers, e.g. SEVEREsourceClass - name of class that issued the logging requestsourceMethod - name of method that issued the logging requestmsg - The string message (or a key in the message catalog)params - Array of parameters to the message
public void logp(Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String msg,
java.lang.Throwable thrown)
If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects.
Note (SAP wrapper): that the thrown argument is stored in the LogRecord parameters property.
level - One of the message level identifiers, e.g. SEVEREsourceClass - name of class that issued the logging requestsourceMethod - name of method that issued the logging requestmsg - The string message (or a key in the message catalog)thrown - Throwable associated with log message.
public void logrb(Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String bundleName,
java.lang.String msg)
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, then the msg string is not localized.
level - One of the message level identifiers, e.g. SEVEREsourceClass - name of class that issued the logging requestsourceMethod - name of method that issued the logging requestbundleName - name of resource bundle to localize msgmsg - The string message (or a key in the message catalog)java.util.MissingResourceException - if no suitable ResourceBundle can be
found.
public void logrb(Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String bundleName,
java.lang.String msg,
java.lang.Object param1)
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, then the msg string is not localized.
level - One of the message level identifiers, e.g. SEVEREsourceClass - name of class that issued the logging requestsourceMethod - name of method that issued the logging requestbundleName - name of resource bundle to localize msgmsg - The string message (or a key in the message catalog)param1 - Parameter to the log messagejava.util.MissingResourceException - if no suitable ResourceBundle can be
found.
public void logrb(Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String bundleName,
java.lang.String msg,
java.lang.Object[] params)
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, then the msg string is not localized.
level - One of the message level identifiers, e.g. SEVEREsourceClass - name of class that issued the logging requestsourceMethod - name of method that issued the logging requestbundleName - name of resource bundle to localize msgmsg - The string message (or a key in the message catalog)params - Array of parameters to the messagejava.util.MissingResourceException - if no suitable ResourceBundle can be
found.
public void logrb(Level level,
java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.String bundleName,
java.lang.String msg,
java.lang.Throwable thrown)
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, then the msg string is not localized.
Note (SAP wrapper): that the thrown argument is stored in the LogRecord parameters property
level - One of the message level identifiers, e.g. SEVEREsourceClass - name of class that issued the logging requestsourceMethod - name of method that issued the logging requestbundleName - name of resource bundle to localize msgmsg - The string message (or a key in the message catalog)thrown - Throwable associated with log message.java.util.MissingResourceException - if no suitable ResourceBundle can be
found.
public void entering(java.lang.String sourceClass,
java.lang.String sourceMethod)
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.
sourceClass - name of class that issued the logging requestsourceMethod - name of method that is being entered
public void entering(java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.Object param1)
This is a convenience method that can be used to log entry to a method. A LogRecord with message "ENTRY with {0}", log level FINER, and the given sourceMethod and sourceClass and parameter is logged.
sourceClass - name of class that issued the logging requestsourceMethod - name of method that is being enteredparam1 - parameter to the method being entered
public void entering(java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.Object[] params)
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 and sourceClass, and parameters is logged.
sourceClass - name of class that issued the logging requestsourceMethod - name of method that is being enteredparams - array of parameters to the method being entered
public void exiting(java.lang.String sourceClass,
java.lang.String sourceMethod)
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.
sourceClass - name of class that issued the logging requestsourceMethod - name of the method
public void exiting(java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.Object result)
This is a convenience method that can be used to log returning from a method. A LogRecord with message "RETURN with {0}", log level FINER, and the given sourceMethod and sourceClass, and result object is logged.
sourceClass - name of class that issued the logging requestsourceMethod - name of the methodresult - Object that is being returned
public void throwing(java.lang.String sourceClass,
java.lang.String sourceMethod,
java.lang.Throwable thrown)
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 it is forwarded to all registered output destinations. The LogRecord's message is set to "THROWING {0}".
Note that the thrown argument is stored in the LogRecord parameters property.
sourceClass - name of class that issued the logging requestsourceMethod - name of the method.thrown - The Throwable that is being thrown.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||