public class DBLog
extends java.lang.Object
Logger
javadoc for more details.
Examples:
DBLog.getLogger( this ).log( Level.SEVERE, "Error updating object", exception ); DBLog.getLogger( this ).log( Level.FINER, "Processing took {0} seconds", timing ); DBLog.getLogger( this ).log( Level.FINE, "ID didn't resolve, processing {0} {1} by name instead.", new Object[]{ type, name } ); DBLog.getLogger( this ).log( Level.FINE, "provider {0} closed", proName );
Constructor and Description |
---|
DBLog() |
Modifier and Type | Method and Description |
---|---|
static java.util.logging.Logger |
getAndInitialiseLogger(java.lang.String name)
Deprecated.
use
getLogger(Object) . |
static java.util.logging.Level |
getEventLogLevel()
Deprecated.
with no replacement. Use the desired level directly.
|
static java.util.logging.Level |
getExceptionLogLevel()
Gets the level to log non-fatal, unexpected exceptions on.
|
static java.util.logging.Logger |
getLogger()
Deprecated.
use
getLogger(Object) to provide the context for
the logger. |
static java.util.logging.Logger |
getLogger(java.lang.Object caller)
Returns the Logger appropriate to the given object or class, initialized
using
getAndInitialiseLogger(java.lang.String) . |
static java.util.logging.Logger |
getSQLLog()
Returns the SQL log - any commands issued to the database should be trace
printed using this log.
|
static java.util.logging.Level |
getTimingLogLevel()
Deprecated.
with no replacement. Use the desired level directly.
|
static java.util.logging.Level |
getTraceLogLevel()
Deprecated.
with no replacement. Use the desired level directly.
|
static boolean |
isDebug()
Tests whether the api is in "debug" mode.
|
static void |
log(java.lang.String msg,
java.lang.Object... params)
Deprecated.
log using a particular logger returned by
getLogger(Object) . |
static void |
logDifferences(DBObject obj1,
DBObject obj2,
DBObjectProvider pro)
Deprecated.
with no replacement
|
static void |
logIllegalState(java.lang.String msg)
Logs that the caller is in a unexpected illegal state that is not
fatal.
|
static void |
logStackTrace(java.lang.String msg,
java.lang.Throwable t)
Logs the given exception.
|
static void |
logStackTrace(java.lang.Throwable t)
Logs the given exception.
|
@Deprecated public static final java.util.logging.Logger getLogger()
getLogger(Object)
to provide the context for
the logger.public static final java.util.logging.Logger getLogger(java.lang.Object caller)
getAndInitialiseLogger(java.lang.String)
. The package of the class is used as
the logger name.
The given caller object must be from the db code base or an IllegalArgumentException will be dumped and a default Logger for "oracle.javatools.db" returned.
caller
- the calling/context object from db code that a logger is
required for. This can be a String to use a specific class/package name.@Deprecated public static final java.util.logging.Logger getAndInitialiseLogger(java.lang.String name)
getLogger(Object)
.@Deprecated public static final java.util.logging.Level getTimingLogLevel()
@Deprecated public static final java.util.logging.Level getTraceLogLevel()
@Deprecated public static final java.util.logging.Level getEventLogLevel()
public static boolean isDebug()
public static final java.util.logging.Level getExceptionLogLevel()
Level.WARNING
unless we are in debug mode
then it is Level.SEVERE
(to induce FCPAUTO at design-time).
Using this means that "real users" won't get a dialog because of the
error. If an exception is fatal, use Level.SEVERE
directly
instead of this method to ensure that they do.
public static void logIllegalState(java.lang.String msg)
Both the stack trace, and the log record, will appear to be from the code that calls this method. It will be logged on the Logger for the class that contains the calling method (which could be a superclass of the actual instance).
msg
- the message to explain the illegal state (does not need nls)context
- the caller/context object for the stateisDebug()
public static final void logStackTrace(java.lang.Throwable t)
The exception will be logged on SEVERE in debug mode (resulting in FCPAUTO in the product), or WARNING in nondebugmode (dumping in to the console).
Warning: the Logger used will be determined from the calling class
name, and this can be different to the Logger returned by calling
DBLog.getLogger( this )
in the same code (if the code is in a
superclass). If a specific Logger is required/available simply use
getExceptionLogLevel()
and log directly.
t
- the throwable to log the stack forgetExceptionLogLevel()
public static final void logStackTrace(java.lang.String msg, java.lang.Throwable t)
The exception will be logged on SEVERE in debug mode (resulting in FCPAUTO in the product), or WARNING in nondebugmode (dumping in to the console).
Warning: the Logger used will be determined from the calling class
name, and this can be different to the Logger returned by calling
DBLog.getLogger( this )
in the same code (if the code is in a
superclass). If a specific Logger is required/available simply use
getExceptionLogLevel()
and log directly.
msg
- the message to log that explains the call that failed with
the given throwablet
- the throwable to log the stack forgetExceptionLogLevel()
@Deprecated public static final void log(java.lang.String msg, java.lang.Object... params)
getLogger(Object)
.@Deprecated public static final void logDifferences(DBObject obj1, DBObject obj2, DBObjectProvider pro)
public static final java.util.logging.Logger getSQLLog()