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

B32476-03

oracle.toplink.logging
Interface SessionLog

All Superinterfaces:
java.lang.Cloneable, SessionLog

public interface SessionLog
extends SessionLog, java.lang.Cloneable

SessionLog is the ever-so-simple interface used by TopLink to log generated messages and SQL. An implementor of this interface can be passed to the TopLink session (via the #setSessionLog(SessionLog) method); and all logging data will be passed through to the implementor via an instance of SessionLogEntry. This can be used to supplement debugging; or the entries could be stored in a database instead of logged to System.out; etc.

Since:
TOPLink/Java 3.0
See Also:
AbstractSessionLog, SessionLogEntry, Session

Field Summary
static int ALL
           
static java.lang.String ALL_LABEL
           
static int CONFIG
           
static java.lang.String CONFIG_LABEL
           
static int FINE
           
static java.lang.String FINE_LABEL
           
static int FINER
           
static java.lang.String FINER_LABEL
           
static int FINEST
           
static java.lang.String FINEST_LABEL
           
static int INFO
           
static java.lang.String INFO_LABEL
           
static java.lang.String OFF_LABEL
           
static int SEVERE
           
static java.lang.String SEVERE_LABEL
           
static int WARNING
           
static java.lang.String WARNING_LABEL
           
 
Fields inherited from interface oracle.toplink.sessions.SessionLog
CACHE, CONNECTION, DMS, EJB, EJB_OR_METADATA, EVENT, loggerCatagories, OFF, PROPAGATION, PROPERTIES, QUERY, SEQUENCING, SERVER, SQL, TRANSACTION, WEAVER
 
Method Summary
 java.lang.Object clone()
          Clone the log.
 void config(java.lang.String message)
          This method is called when a config level message needs to be logged.
 void fine(java.lang.String message)
          This method is called when a fine level message needs to be logged.
 void finer(java.lang.String message)
          This method is called when a finer level message needs to be logged.
 void finest(java.lang.String message)
          This method is called when a finest level message needs to be logged.
 int getLevel()
          Return the log level.
 int getLevel(java.lang.String category)
          Return the log level.
 Session getSession()
          Get the session that owns this SessionLog.
 java.io.Writer getWriter()
          Return the writer to which an accessor writes logged messages and SQL.
 void info(java.lang.String message)
          This method is called when a info level message needs to be logged.
 void log(int level, java.lang.String message)
          Log a message that does not need to be translated.
 void log(int level, java.lang.String message, java.lang.Object param)
          Log a message with one parameter that needs to be translated.
 void log(int level, java.lang.String message, java.lang.Object[] arguments)
          This method is called when the log request is from somewhere session is not available.
 void log(int level, java.lang.String message, java.lang.Object[] arguments, boolean shouldTranslate)
          This method is called when the log request is from somewhere session is not available.
 void log(int level, java.lang.String message, java.lang.Object param1, java.lang.Object param2)
          Log a message with two parameters that needs to be translated.
 void log(int level, java.lang.String message, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3)
          Log a message with three parameters that needs to be translated.
 void log(SessionLogEntry entry)
          TopLink will call this method whenever something needs to be logged (messages, SQL, etc.).
 void logThrowable(int level, java.lang.Throwable throwable)
          Log a throwable with level.
 void setLevel(int level)
          Set the log level.
 void setLevel(int level, java.lang.String category)
          Set the log level.
 void setSession(Session session)
          Set the session that owns this SessionLog.
 void setShouldLogExceptionStackTrace(boolean flag)
          By default stack trace is logged for SEVERE all the time and at FINER level for WARNING or less.
 void setShouldPrintConnection(boolean flag)
          By default the connection is always printed whenever available, this can be turned off.
 void setShouldPrintDate(boolean flag)
          By default date is printed, this can be turned off.
 void setShouldPrintSession(boolean flag)
          By default the Session is always printed whenever available, this can be turned off.
 void setShouldPrintThread(boolean flag)
          By default the thread is logged at FINE or less level, this can be turned off.
 void setWriter(java.io.Writer log)
          Set the writer to which an accessor writes logged messages and SQL.
 void severe(java.lang.String message)
          This method is called when a severe level message needs to be logged.
 boolean shouldLog(int level)
          Check if a message of the given level would actually be logged.
 boolean shouldLog(int level, java.lang.String category)
          Check if a message of the given level would actually be logged.
 boolean shouldLogExceptionStackTrace()
          By default the stack trace is logged for SEVERE all the time and at FINER level for WARNING or less, this can be turned off.
 boolean shouldPrintConnection()
          By default the connection is always printed whenever available, this can be turned off.
 boolean shouldPrintDate()
          By default the date is always printed, this can be turned off.
 boolean shouldPrintSession()
          By default the Session is always printed whenever available, this can be turned off.
 boolean shouldPrintThread()
          By default the thread is logged at FINE or less level, this can be turned off.
 void throwing(java.lang.Throwable throwable)
          This method is called when a throwable at finer level needs to be logged.
 void warning(java.lang.String message)
          This method is called when a warning level message needs to be logged.
 
Methods inherited from interface oracle.toplink.sessions.SessionLog
getLevelString, log, setShouldLogDebug, setShouldLogExceptions, shouldLogDebug, shouldLogExceptions
 

Field Detail

OFF_LABEL

static final java.lang.String OFF_LABEL
See Also:
Constant Field Values

SEVERE

static final int SEVERE
See Also:
Constant Field Values

SEVERE_LABEL

static final java.lang.String SEVERE_LABEL
See Also:
Constant Field Values

WARNING

static final int WARNING
See Also:
Constant Field Values

WARNING_LABEL

static final java.lang.String WARNING_LABEL
See Also:
Constant Field Values

INFO

static final int INFO
See Also:
Constant Field Values

INFO_LABEL

static final java.lang.String INFO_LABEL
See Also:
Constant Field Values

CONFIG

static final int CONFIG
See Also:
Constant Field Values

CONFIG_LABEL

static final java.lang.String CONFIG_LABEL
See Also:
Constant Field Values

FINE

static final int FINE
See Also:
Constant Field Values

FINE_LABEL

static final java.lang.String FINE_LABEL
See Also:
Constant Field Values

FINER

static final int FINER
See Also:
Constant Field Values

FINER_LABEL

static final java.lang.String FINER_LABEL
See Also:
Constant Field Values

FINEST

static final int FINEST
See Also:
Constant Field Values

FINEST_LABEL

static final java.lang.String FINEST_LABEL
See Also:
Constant Field Values

ALL

static final int ALL
See Also:
Constant Field Values

ALL_LABEL

static final java.lang.String ALL_LABEL
See Also:
Constant Field Values
Method Detail

log

void log(SessionLogEntry entry)
TopLink will call this method whenever something needs to be logged (messages, SQL, etc.). All the pertinent information will be contained in the specified entry.

Specified by:
log in interface SessionLog
Parameters:
entry - oracle.toplink.sessions.LogEntry

shouldLogExceptionStackTrace

boolean shouldLogExceptionStackTrace()
By default the stack trace is logged for SEVERE all the time and at FINER level for WARNING or less, this can be turned off.

Specified by:
shouldLogExceptionStackTrace in interface SessionLog

shouldPrintDate

boolean shouldPrintDate()
By default the date is always printed, this can be turned off.

Specified by:
shouldPrintDate in interface SessionLog

shouldPrintThread

boolean shouldPrintThread()
By default the thread is logged at FINE or less level, this can be turned off.

Specified by:
shouldPrintThread in interface SessionLog

shouldPrintConnection

boolean shouldPrintConnection()
By default the connection is always printed whenever available, this can be turned off.

Specified by:
shouldPrintConnection in interface SessionLog

shouldPrintSession

boolean shouldPrintSession()
By default the Session is always printed whenever available, this can be turned off.

Specified by:
shouldPrintSession in interface SessionLog

setShouldLogExceptionStackTrace

void setShouldLogExceptionStackTrace(boolean flag)
By default stack trace is logged for SEVERE all the time and at FINER level for WARNING or less. This can be turned off.

Specified by:
setShouldLogExceptionStackTrace in interface SessionLog

setShouldPrintDate

void setShouldPrintDate(boolean flag)
By default date is printed, this can be turned off.

Specified by:
setShouldPrintDate in interface SessionLog

setShouldPrintThread

void setShouldPrintThread(boolean flag)
By default the thread is logged at FINE or less level, this can be turned off.

Specified by:
setShouldPrintThread in interface SessionLog

setShouldPrintConnection

void setShouldPrintConnection(boolean flag)
By default the connection is always printed whenever available, this can be turned off.

Specified by:
setShouldPrintConnection in interface SessionLog

setShouldPrintSession

void setShouldPrintSession(boolean flag)
By default the Session is always printed whenever available, this can be turned off.

Specified by:
setShouldPrintSession in interface SessionLog

getWriter

java.io.Writer getWriter()
Return the writer to which an accessor writes logged messages and SQL. If not set, this reference usually defaults to a writer on System.out. To enable logging, logMessages must be turned on in the session.

Specified by:
getWriter in interface SessionLog

setWriter

void setWriter(java.io.Writer log)
Set the writer to which an accessor writes logged messages and SQL. If not set, this reference usually defaults to a writer on System.out. To enable logging, logMessages() is used on the session.

Specified by:
setWriter in interface SessionLog

getLevel

int getLevel()
Return the log level. Used when session is not available.

Specified by:
getLevel in interface SessionLog

getLevel

int getLevel(java.lang.String category)
Return the log level. category is only needed where name space is available.

Specified by:
getLevel in interface SessionLog

setLevel

void setLevel(int level)
Set the log level. Used when session is not available.

Specified by:
setLevel in interface SessionLog

setLevel

void setLevel(int level,
              java.lang.String category)
Set the log level. Category is only needed where name space is available.

Specified by:
setLevel in interface SessionLog

shouldLog

boolean shouldLog(int level)
Check if a message of the given level would actually be logged. Used when session is not available.

Specified by:
shouldLog in interface SessionLog

shouldLog

boolean shouldLog(int level,
                  java.lang.String category)
Check if a message of the given level would actually be logged. Category is only needed where name space is available.

Specified by:
shouldLog in interface SessionLog

log

void log(int level,
         java.lang.String message)
Log a message that does not need to be translated. This method is intended for external use when logging messages are wanted within the TopLink output.

Specified by:
log in interface SessionLog

log

void log(int level,
         java.lang.String message,
         java.lang.Object param)
Log a message with one parameter that needs to be translated.

Specified by:
log in interface SessionLog

log

void log(int level,
         java.lang.String message,
         java.lang.Object param1,
         java.lang.Object param2)
Log a message with two parameters that needs to be translated.

Specified by:
log in interface SessionLog

log

void log(int level,
         java.lang.String message,
         java.lang.Object param1,
         java.lang.Object param2,
         java.lang.Object param3)
Log a message with three parameters that needs to be translated.

Specified by:
log in interface SessionLog

log

void log(int level,
         java.lang.String message,
         java.lang.Object[] arguments)
This method is called when the log request is from somewhere session is not available. The message needs to be translated.

Specified by:
log in interface SessionLog

log

void log(int level,
         java.lang.String message,
         java.lang.Object[] arguments,
         boolean shouldTranslate)
This method is called when the log request is from somewhere session is not available. shouldTranslate flag determines if the message needs to be translated.

Specified by:
log in interface SessionLog

throwing

void throwing(java.lang.Throwable throwable)
This method is called when a throwable at finer level needs to be logged.

Specified by:
throwing in interface SessionLog

severe

void severe(java.lang.String message)
This method is called when a severe level message needs to be logged. The message will be translated

Specified by:
severe in interface SessionLog

warning

void warning(java.lang.String message)
This method is called when a warning level message needs to be logged. The message will be translated

Specified by:
warning in interface SessionLog

info

void info(java.lang.String message)
This method is called when a info level message needs to be logged. The message will be translated

Specified by:
info in interface SessionLog

config

void config(java.lang.String message)
This method is called when a config level message needs to be logged. The message will be translated

Specified by:
config in interface SessionLog

fine

void fine(java.lang.String message)
This method is called when a fine level message needs to be logged. The message will be translated

Specified by:
fine in interface SessionLog

finer

void finer(java.lang.String message)
This method is called when a finer level message needs to be logged. The message will be translated

Specified by:
finer in interface SessionLog

finest

void finest(java.lang.String message)
This method is called when a finest level message needs to be logged. The message will be translated

Specified by:
finest in interface SessionLog

logThrowable

void logThrowable(int level,
                  java.lang.Throwable throwable)
Log a throwable with level.

Specified by:
logThrowable in interface SessionLog

getSession

Session getSession()
Get the session that owns this SessionLog.

Specified by:
getSession in interface SessionLog

setSession

void setSession(Session session)
Set the session that owns this SessionLog.

Specified by:
setSession in interface SessionLog

clone

java.lang.Object clone()
Clone the log.


Copyright © 1998, 2010, Oracle. All Rights Reserved.