Interface Logger
- All Known Implementing Classes:
AbstractLogger,LoggerJDK13,LoggerJDK14
The JDO Logger interface contains a small number of convenience methods in addition to a subset of the methods in the java.util.logging.Logger class, and can therefore be implemented in a very straightforward way by a subclass of the java.util.logging.Logger class. There is one instance of the implementing class for each subsystem in JDO.
This interface has no JDK 1.4 dependencies.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intALL indicates that all messages should be logged.static final intCONFIG is a message level for static configuration messages.static final intFINE is a message level providing tracing information.static final intFINER indicates a fairly detailed tracing message.static final intFINEST indicates a highly detailed tracing messagestatic final intINFO is a message level for informational messages.static final intOFF is a special level that can be used to turn off logging.static final intSEVERE is a message level indicating a serious failure.static final intWARNING is a message level indicating a potential problem. -
Method Summary
Modifier and TypeMethodDescriptionvoidLog a CONFIG message.voidLog a method entry.voidLog a method entry, with one parameter.voidLog a method entry, with an array of parameters.voidLog a method return.voidLog a method return, with result object.voidLog a message.voidLog a FINE message.voidLog a FINE message.voidLog a FINE message.voidLog a FINE message.voidLog a FINER message.voidLog a FINER message.voidLog a FINER message.voidLog a FINER message.voidLog a FINER message.voidLog a FINEST message.voidLog a FINEST message.voidLog a FINEST message.voidLog a FINEST message.voidLog a FINEST message.getName()Get the name for this logger.voidLog an INFO message.booleanTest if this logger is logging messages.booleanisLoggable(int level) Test if this logger is logging messages at the specific level.voidLog a message.voidLog a message.voidLog a message.voidLog a message.voidLog a message.voidLog a message.voidLog a SEVERE message.voidLog throwing an exception.voidLog a WARNING message.
-
Field Details
-
OFF
static final int OFFOFF is a special level that can be used to turn off logging.- See Also:
-
SEVERE
static final int SEVERESEVERE is a message level indicating a serious failure.In general SEVERE messages should describe events that are of considerable importance and which will prevent normal program execution. They should be reasonably intelligible to end users and to system administrators.
- See Also:
-
WARNING
static final int WARNINGWARNING is a message level indicating a potential problem.In general WARNING messages should describe events that will be of interest to end users or system managers, or which indicate potential problems.
- See Also:
-
INFO
static final int INFOINFO is a message level for informational messages.Typically INFO messages will be written to the console or its equivalent. So the INFO level should only be used for reasonably significant messages that will make sense to end users and system admins.
- See Also:
-
CONFIG
static final int CONFIGCONFIG is a message level for static configuration messages.CONFIG messages are intended to provide a variety of static configuration information, to assist in debugging problems that may be associated with particular configurations. For example, CONFIG message might include the CPU type, the graphics depth, the GUI look-and-feel, etc.
- See Also:
-
FINE
static final int FINEFINE is a message level providing tracing information.All of FINE, FINER, and FINEST are intended for relatively detailed tracing. The exact meaning of the three levels will vary between subsystems, but in general, FINEST should be used for the most voluminous detailed output, FINER for somewhat less detailed output, and FINE for the lowest volume (and most important) messages.
In general the FINE level should be used for information that will be broadly interesting to developers who do not have a specialized interest in the specific subsystem.
FINE messages might include things like minor (recoverable) failures. Issues indicating potential performance problems are also worth logging as FINE.
- See Also:
-
FINER
static final int FINERFINER indicates a fairly detailed tracing message. By default logging calls for entering, returning, or throwing an exception are traced at this level.- See Also:
-
FINEST
static final int FINESTFINEST indicates a highly detailed tracing message- See Also:
-
ALL
static final int ALLALL indicates that all messages should be logged.- See Also:
-
-
Method Details
-
isLoggable
boolean isLoggable()Test if this logger is logging messages. This is a test for log level FINE, FINER, or FINEST. If the log message is expensive to construct, this method should be used to determine whether it is a waste of time. We don't expose isLoggable(Level) because Level is not available in JDK 1.3. Once this is not an issue, we can add isLoggable(Level).- Returns:
- if FINE, FINER, or FINEST is currently being logged
-
isLoggable
boolean isLoggable(int level) Test if this logger is logging messages at the specific level. If the log message is expensive to construct, this method should be used to determine whether it is a waste of time. We don't expose isLoggable(Level) because Level is not available in JDK 1.3. Once this is not an issue, we can add isLoggable(Level).- Parameters:
level- The level to be tested- Returns:
- if this level is currently being logged
-
entering
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.
- Parameters:
sourceClass- name of class that issued the logging requestsourceMethod- name of method that is being entered
-
entering
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.
- Parameters:
sourceClass- name of class that issued the logging requestsourceMethod- name of method that is being enteredparam1- parameter to the method being entered
-
entering
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.
- Parameters:
sourceClass- name of class that issued the logging requestsourceMethod- name of method that is being enteredparams- array of parameters to the method being entered
-
exiting
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.
- Parameters:
sourceClass- name of class that issued the logging requestsourceMethod- name of the method
-
exiting
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.
- Parameters:
sourceClass- name of class that issued the logging requestsourceMethod- name of the methodresult- Object that is being returned
-
throwing
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 is it processed specially by output Formatters and is not treated as a formatting parameter to the LogRecord message property.
- Parameters:
sourceClass- name of class that issued the logging requestsourceMethod- name of the method.thrown- The Throwable that is being thrown.
-
severe
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.
- Parameters:
msg- The string message (or a key in the message catalog)
-
warning
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.
- Parameters:
msg- The string message (or a key in the message catalog)
-
info
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.
- Parameters:
msg- The string message (or a key in the message catalog)
-
config
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.
- Parameters:
msg- The string message (or a key in the message catalog)
-
log
Log a message.If the logger is currently enabled for the message level then the given message is forwarded to all the registered output Handler objects.
- Parameters:
level- The level for this messagemsg- The string message (or a key in the message catalog)
-
log
Log a message.If the logger is currently enabled for the message level then the given message is forwarded to all the registered output Handler objects.
- Parameters:
level- The level for this messagemsg- The string message (or a key in the message catalog)o1- A parameter to be inserted into the message
-
log
Log a message.If the logger is currently enabled for the message level then the given message is forwarded to all the registered output Handler objects.
- Parameters:
level- The level for this messagemsg- The string message (or a key in the message catalog)o- Objects to be inserted into the message
-
log
Log a message.If the logger is currently enabled for the message level then the given message is forwarded to all the registered output Handler objects.
- Parameters:
level- The level for this messagemsg- The string message (or a key in the message catalog)o1- A parameter to be inserted into the messageo2- A parameter to be inserted into the message
-
log
Log a message.If the logger is currently enabled for the message level then the given message is forwarded to all the registered output Handler objects.
- Parameters:
level- The level for this messagemsg- The string message (or a key in the message catalog)o1- A parameter to be inserted into the messageo2- A parameter to be inserted into the messageo3- A parameter to be inserted into the message
-
log
Log a message.If the logger is currently enabled for the message level then the given message, and the exception dump, is forwarded to all the registered output Handler objects.
- Parameters:
level- The level for this messagemsg- The string message (or a key in the message catalog)thrown- The exception to log
-
fine
Log a message.If the logger is currently enabled for the message level then the given message is forwarded to all the registered output Handler objects.
- Parameters:
msg- The string message (or a key in the message catalog)
-
fine
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.
- Parameters:
msg- The string message (or a key in the message catalog)o1- A parameter to be inserted into the message
-
fine
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.
- Parameters:
msg- The string message (or a key in the message catalog)o- Objects to be inserted into the message
-
fine
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.
- Parameters:
msg- The string message (or a key in the message catalog)o1- A parameter to be inserted into the messageo2- A parameter to be inserted into the message
-
fine
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.
- Parameters:
msg- The string message (or a key in the message catalog)o1- A parameter to be inserted into the messageo2- A parameter to be inserted into the messageo3- A parameter to be inserted into the message
-
finer
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.
- Parameters:
msg- The string message (or a key in the message catalog)
-
finer
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.
- Parameters:
msg- The string message (or a key in the message catalog)o- Objects to be inserted into the message
-
finer
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.
- Parameters:
msg- The string message (or a key in the message catalog)o1- A parameter to be inserted into the message
-
finer
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.
- Parameters:
msg- The string message (or a key in the message catalog)o1- A parameter to be inserted into the messageo2- A parameter to be inserted into the message
-
finer
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.
- Parameters:
msg- The string message (or a key in the message catalog)o1- A parameter to be inserted into the messageo2- A parameter to be inserted into the messageo3- A parameter to be inserted into the message
-
finest
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.
- Parameters:
msg- The string message (or a key in the message catalog)
-
finest
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.
- Parameters:
msg- The string message (or a key in the message catalog)o- Objects to be inserted into the message
-
finest
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.
- Parameters:
msg- The string message (or a key in the message catalog)o1- A parameter to be inserted into the message
-
finest
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.
- Parameters:
msg- The string message (or a key in the message catalog)o1- A parameter to be inserted into the messageo2- A parameter to be inserted into the message
-
finest
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.
- Parameters:
msg- The string message (or a key in the message catalog)o1- A parameter to be inserted into the messageo2- A parameter to be inserted into the messageo3- A parameter to be inserted into the message
-
getName
String getName()Get the name for this logger.- Returns:
- logger name. Will be null for anonymous Loggers.
-