Skip navigation links

Oracle TopLink Java API Reference
10g Release 3 (10.1.3.1)

B28219-01


oracle.toplink.logging
Interface SessionLog

All Superinterfaces:
SessionLog
All Known Implementing Classes:
AbstractSessionLog

public interface SessionLog
extends SessionLog

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 CACHE
           
static int CONFIG
           
static java.lang.String CONNECTION
           
static java.lang.String DMS
           
static java.lang.String EJB
           
static java.lang.String EJB_ANNOTATION
           
static java.lang.String EVENT
           
static int FINE
           
static int FINER
           
static int FINEST
           
static int INFO
           
static int OFF
           
static java.lang.String PROPAGATION
           
static java.lang.String QUERY
           
static java.lang.String SEQUENCING
           
static int SEVERE
           
static java.lang.String SQL
           
static java.lang.String TRANSACTION
           
static int WARNING
           
static java.lang.String WEAVER
           

 

Method Summary
 void config(java.lang.String message)
          PUBLIC: This method is called when a config level message needs to be logged.
 void fine(java.lang.String message)
          PUBLIC: This method is called when a fine level message needs to be logged.
 void finer(java.lang.String message)
          PUBLIC: This method is called when a finer level message needs to be logged.
 void finest(java.lang.String message)
          PUBLIC: This method is called when a finest level message needs to be logged.
 int getLevel()
          PUBLIC: Return the log level.
 int getLevel(java.lang.String category)
          PUBLIC: Return the log level.
 Session getSession()
          PUBLIC: Get the session that owns this SessionLog.
 java.io.Writer getWriter()
          PUBLIC: Return the writer to which an accessor writes logged messages and SQL.
 void info(java.lang.String message)
          PUBLIC: This method is called when a info level message needs to be logged.
 void log(int level, java.lang.String message)
          PUBLIC: Log a message that does not need to be translated.
 void log(int level, java.lang.String message, java.lang.Object param)
          PUBLIC: Log a message with one parameter that needs to be translated.
 void log(int level, java.lang.String message, java.lang.Object[] arguments)
          PUBLIC: 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)
          PUBLIC: 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)
          PUBLIC: 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)
          PUBLIC: Log a message with three parameters that needs to be translated.
 void log(SessionLogEntry entry)
          PUBLIC: TopLink will call this method whenever something needs to be logged (messages, SQL, etc.).
 void logThrowable(int level, java.lang.Throwable throwable)
          PUBLIC: Log a throwable with level.
 void setLevel(int level)
          PUBLIC: Set the log level.
 void setLevel(int level, java.lang.String category)
          PUBLIC: Set the log level.
 void setSession(Session session)
          PUBLIC: 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)
          PUBLIC: Set the writer to which an accessor writes logged messages and SQL.
 void severe(java.lang.String message)
          PUBLIC: This method is called when a severe level message needs to be logged.
 boolean shouldLog(int level)
          PUBLIC: Check if a message of the given level would actually be logged.
 boolean shouldLog(int level, java.lang.String category)
          PUBLIC: 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)
          PUBLIC: This method is called when a throwable at finer level needs to be logged.
 void warning(java.lang.String message)
          PUBLIC: This method is called when a warning level message needs to be logged.

 

Methods inherited from interface oracle.toplink.sessions.SessionLog
log, setShouldLogDebug, setShouldLogExceptions, shouldLogDebug, shouldLogExceptions

 

Field Detail

OFF

public static final int OFF
See Also:
Constant Field Values

SEVERE

public static final int SEVERE
See Also:
Constant Field Values

WARNING

public static final int WARNING
See Also:
Constant Field Values

INFO

public static final int INFO
See Also:
Constant Field Values

CONFIG

public static final int CONFIG
See Also:
Constant Field Values

FINE

public static final int FINE
See Also:
Constant Field Values

FINER

public static final int FINER
See Also:
Constant Field Values

FINEST

public static final int FINEST
See Also:
Constant Field Values

ALL

public static final int ALL
See Also:
Constant Field Values

SQL

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

TRANSACTION

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

EVENT

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

CONNECTION

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

QUERY

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

CACHE

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

PROPAGATION

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

SEQUENCING

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

EJB

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

DMS

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

EJB_ANNOTATION

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

WEAVER

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

Method Detail

log

public void log(SessionLogEntry entry)
PUBLIC: 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

public 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

public boolean shouldPrintDate()
By default the date is always printed, this can be turned off.
Specified by:
shouldPrintDate in interface SessionLog

shouldPrintThread

public 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

public boolean shouldPrintConnection()
By default the connection is always printed whenever available, this can be turned off.
Specified by:
shouldPrintConnection in interface SessionLog

shouldPrintSession

public boolean shouldPrintSession()
By default the Session is always printed whenever available, this can be turned off.
Specified by:
shouldPrintSession in interface SessionLog

setShouldLogExceptionStackTrace

public 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

public void setShouldPrintDate(boolean flag)
By default date is printed, this can be turned off.
Specified by:
setShouldPrintDate in interface SessionLog

setShouldPrintThread

public 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

public 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

public 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

public java.io.Writer getWriter()
PUBLIC: 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

public void setWriter(java.io.Writer log)
PUBLIC: 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

public int getLevel()
PUBLIC: Return the log level. Used when session is not available.
Specified by:
getLevel in interface SessionLog

getLevel

public int getLevel(java.lang.String category)
PUBLIC: Return the log level. category is only needed where name space is available.
Specified by:
getLevel in interface SessionLog

setLevel

public void setLevel(int level)
PUBLIC: Set the log level. Used when session is not available.
Specified by:
setLevel in interface SessionLog

setLevel

public void setLevel(int level,
                     java.lang.String category)
PUBLIC: Set the log level. Category is only needed where name space is available.
Specified by:
setLevel in interface SessionLog

shouldLog

public boolean shouldLog(int level)
PUBLIC: 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

public boolean shouldLog(int level,
                         java.lang.String category)
PUBLIC: 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

public void log(int level,
                java.lang.String message)
PUBLIC: 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

public void log(int level,
                java.lang.String message,
                java.lang.Object param)
PUBLIC: Log a message with one parameter that needs to be translated.
Specified by:
log in interface SessionLog

log

public void log(int level,
                java.lang.String message,
                java.lang.Object param1,
                java.lang.Object param2)
PUBLIC: Log a message with two parameters that needs to be translated.
Specified by:
log in interface SessionLog

log

public void log(int level,
                java.lang.String message,
                java.lang.Object param1,
                java.lang.Object param2,
                java.lang.Object param3)
PUBLIC: Log a message with three parameters that needs to be translated.
Specified by:
log in interface SessionLog

log

public void log(int level,
                java.lang.String message,
                java.lang.Object[] arguments)
PUBLIC: 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

public void log(int level,
                java.lang.String message,
                java.lang.Object[] arguments,
                boolean shouldTranslate)
PUBLIC: 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

public void throwing(java.lang.Throwable throwable)
PUBLIC: This method is called when a throwable at finer level needs to be logged.
Specified by:
throwing in interface SessionLog

severe

public void severe(java.lang.String message)
PUBLIC: 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

public void warning(java.lang.String message)
PUBLIC: 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

public void info(java.lang.String message)
PUBLIC: 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

public void config(java.lang.String message)
PUBLIC: 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

public void fine(java.lang.String message)
PUBLIC: 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

public void finer(java.lang.String message)
PUBLIC: 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

public void finest(java.lang.String message)
PUBLIC: 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

public void logThrowable(int level,
                         java.lang.Throwable throwable)
PUBLIC: Log a throwable with level.
Specified by:
logThrowable in interface SessionLog

getSession

public Session getSession()
PUBLIC: Get the session that owns this SessionLog.
Specified by:
getSession in interface SessionLog

setSession

public void setSession(Session session)
PUBLIC: Set the session that owns this SessionLog.
Specified by:
setSession in interface SessionLog

Skip navigation links

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