FileDocCategorySizeDatePackage
SessionLog.javaAPI DocGlassfish v2 API10847Tue May 22 16:54:44 BST 2007oracle.toplink.essentials.logging

SessionLog

public interface 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.
see
AbstractSessionLog
see
SessionLogEntry
since
TOPLink/Java 3.0

Fields Summary
public static final int
OFF
public static final int
SEVERE
public static final int
WARNING
public static final int
INFO
public static final int
CONFIG
public static final int
FINE
public static final int
FINER
public static final int
FINEST
public static final int
ALL
public static final String
SQL
public static final String
TRANSACTION
public static final String
EVENT
public static final String
CONNECTION
public static final String
QUERY
public static final String
CACHE
public static final String
PROPAGATION
public static final String
SEQUENCING
public static final String
EJB
public static final String
DMS
public static final String
EJB_OR_METADATA
public static final String
WEAVER
public static final String
PROPERTIES
public final String[]
loggerCategories
Constructors Summary
Methods Summary
public voidconfig(java.lang.String message)
PUBLIC: This method is called when a config level message needs to be logged. The message will be translated

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

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

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

public intgetLevel()
PUBLIC: Return the log level. Used when session is not available.

public intgetLevel(java.lang.String category)
PUBLIC: Return the log level. category is only needed where name space is available.

public oracle.toplink.essentials.sessions.SessiongetSession()
PUBLIC: Get the session that owns this SessionLog.

public java.io.WritergetWriter()
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.

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

public voidlog(oracle.toplink.essentials.logging.SessionLogEntry entry)
INTERNAL: 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.

param
entry oracle.toplink.essentials.sessions.LogEntry

public voidlog(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.

public voidlog(int level, java.lang.String message, java.lang.Object param)
INTERNAL: Log a message with one parameter that needs to be translated.

public voidlog(int level, java.lang.String message, java.lang.Object param1, java.lang.Object param2)
INTERNAL: Log a message with two parameters that needs to be translated.

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

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

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

public voidlogThrowable(int level, java.lang.Throwable throwable)
PUBLIC: Log a throwable with level.

public voidsetLevel(int level)
PUBLIC: Set the log level. Used when session is not available.

public voidsetLevel(int level, java.lang.String category)
PUBLIC: Set the log level. Category is only needed where name space is available.

public voidsetSession(oracle.toplink.essentials.sessions.Session session)
PUBLIC: Set the session that owns this SessionLog.

public voidsetShouldLogExceptionStackTrace(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.

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

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

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

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

public voidsetWriter(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.

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

public booleanshouldLog(int level)
PUBLIC: Check if a message of the given level would actually be logged. Used when session is not available.

public booleanshouldLog(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.

public booleanshouldLogExceptionStackTrace()
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.

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

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

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

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

public voidthrowing(java.lang.Throwable throwable)
PUBLIC: This method is called when a throwable at finer level needs to be logged.

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