Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

oracle.javatools.db
Class DBLog

java.lang.Object
  extended by oracle.javatools.db.DBLog

public class DBLog
extends java.lang.Object

Log utilities for the core database functionality. Uses the java.util.logging support with a logger called "oracle.javatools.db". See the Logger javadoc for more details.

Examples:

 DBLog.getLogger( this ).log( Level.SEVERE, "Error updating object", exception );

 DBLog.getLogger( this ).log( DBLog.getTimingLogLevel(),
                              "Processing took {0} seconds",
                              timing );

 DBLog.getLogger( this ).log( DBLog.getTraceLogLevel(),
                              "ID didn't resolve, processing {0} {1} by name instead.",
                              new Object[]{ type, name } );

 DBLog.getLogger( this ).log( DBLog.getEventLogLevel(), "provider {0} closed", proName );
 


Constructor Summary
DBLog()
           
 
Method Summary
static java.util.logging.Logger getAndInitialiseLogger(java.lang.String name)
           
static java.util.logging.Level getEventLogLevel()
          Returns the logging level to use for logging db-api event information.
static java.util.logging.Logger getLogger()
          Returns the Logger for logging of information, warning and error messages in the api.
static java.util.logging.Logger getLogger(java.lang.Object obj)
          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()
          Returns the logging level to use for logging db-api timings (e.g.
static java.util.logging.Level getTraceLogLevel()
          Returns the logging level to use for logging db-api tracing (for example sql execution, diff result set print outs etc).
static void initLogger(java.util.logging.Logger logger)
           
static void log(java.lang.String msg, java.lang.Object... params)
          Logs the given message to the tracing log level.
static void logDifferences(DBObject obj1, DBObject obj2, DBObjectProvider pro)
          Prints out the differences between the two objects to the trace log level.
static void logStackTrace(java.lang.Throwable t)
          Logs the given exception if the db_api tracing is enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBLog

public DBLog()
Method Detail

getLogger

public static final java.util.logging.Logger getLogger()
Returns the Logger for logging of information, warning and error messages in the api.


getLogger

public static final java.util.logging.Logger getLogger(java.lang.Object obj)
Returns the Logger appropriate to the given object or class, initialized using getAndInitialiseLogger(java.lang.String). The package of the class is used as the logger name.


getAndInitialiseLogger

public static final java.util.logging.Logger getAndInitialiseLogger(java.lang.String name)

getTimingLogLevel

public static final java.util.logging.Level getTimingLogLevel()
Returns the logging level to use for logging db-api timings (e.g. opening connections, building objects, etc).


getTraceLogLevel

public static final java.util.logging.Level getTraceLogLevel()
Returns the logging level to use for logging db-api tracing (for example sql execution, diff result set print outs etc).


getEventLogLevel

public static final java.util.logging.Level getEventLogLevel()
Returns the logging level to use for logging db-api event information.


logStackTrace

public static final void logStackTrace(java.lang.Throwable t)
Logs the given exception if the db_api tracing is enabled. It is better not to use this method, but to use getLogger() and log the throwable at the appropriate level directly. It means the logging information will be more accurate.

As the stack trace will be logged to the trace level it will not appear in normal builds. Use getLogger() and log to Level.SEVERE, Level.WARNING or Level.INFO for that to happen.


log

public static final void log(java.lang.String msg,
                             java.lang.Object... params)
Logs the given message to the tracing log level. Use for general messages that don't have a specific level specified (i.e. event or timing messages).

Parameters:
msg - the message to log
params - optional parameters for the message to be formatted with
See Also:
getTraceLogLevel()

logDifferences

public static final void logDifferences(DBObject obj1,
                                        DBObject obj2,
                                        DBObjectProvider pro)
Prints out the differences between the two objects to the trace log level.

See Also:
getTraceLogLevel()

getSQLLog

public static final java.util.logging.Logger getSQLLog()
Returns the SQL log - any commands issued to the database should be trace printed using this log.


initLogger

public static void initLogger(java.util.logging.Logger logger)

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

Copyright © 1997, 2010, Oracle. All rights reserved.