Oracle Application Server TopLink API Reference
10g Release 2 (10.1.2)

B15903-01


oracle.toplink.sessions
Interface SessionLog

All Known Implementing Classes:
DefaultSessionLog

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.

Since:
TOPLink/Java 3.0
See Also:
DefaultSessionLog, SessionLogEntry

Method Summary
 java.io.Writer getWriter()
          PUBLIC: Return the writer to which an accessor writes logged messages and SQL.
 void log(SessionLogEntry entry)
          PUBLIC: TopLink will call this method whenever something needs to be logged (messages, SQL, etc.).
 void setShouldLogDebug(boolean flag)
          PUBLIC: Call this method to set whether debugging info is logged.
 void setShouldLogExceptions(boolean flag)
          PUBLIC: Call this method to set whether exceptions are logged.
 void setShouldLogExceptionStackTrace(boolean flag)
          PUBLIC: Call this method to set whether exception stack traces are logged.
 void setShouldPrintConnection(boolean flag)
          PUBLIC: Call this method to set whether the connection is logged.
 void setShouldPrintDate(boolean flag)
          PUBLIC: Call this method to set whether the date is logged.
 void setShouldPrintSession(boolean flag)
          PUBLIC: Call this method to set whether the session is logged.
 void setShouldPrintThread(boolean flag)
          PUBLIC: Call this method to set whether the thread info is logged.
 void setWriter(java.io.Writer log)
          PUBLIC: Set the writer to which an accessor writes logged messages and SQL.
 boolean shouldLogDebug()
          PUBLIC: Call this method to determine whether debugging info is logged.
 boolean shouldLogExceptions()
          PUBLIC: Call this method to determine whether exceptions are logged.
 boolean shouldLogExceptionStackTrace()
          PUBLIC: Call this method to determine whether exception stack traces are logged.
 boolean shouldPrintConnection()
          PUBLIC: Call this method to determine whether the connection is logged.
 boolean shouldPrintDate()
          PUBLIC: Call this method to determine whether the date is logged.
 boolean shouldPrintSession()
          PUBLIC: Call this method to determine whether the session is logged.
 boolean shouldPrintThread()
          PUBLIC: Call this method to determine whether the thread info is logged.

 

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.
Parameters:
entry - oracle.toplink.sessions.LogEntry

shouldLogDebug

public boolean shouldLogDebug()
PUBLIC: Call this method to determine whether debugging info is logged.

shouldLogExceptions

public boolean shouldLogExceptions()
PUBLIC: Call this method to determine whether exceptions are logged.

shouldLogExceptionStackTrace

public boolean shouldLogExceptionStackTrace()
PUBLIC: Call this method to determine whether exception stack traces are logged.

shouldPrintDate

public boolean shouldPrintDate()
PUBLIC: Call this method to determine whether the date is logged.

shouldPrintThread

public boolean shouldPrintThread()
PUBLIC: Call this method to determine whether the thread info is logged.

shouldPrintConnection

public boolean shouldPrintConnection()
PUBLIC: Call this method to determine whether the connection is logged.

shouldPrintSession

public boolean shouldPrintSession()
PUBLIC: Call this method to determine whether the session is logged.

setShouldLogDebug

public void setShouldLogDebug(boolean flag)
PUBLIC: Call this method to set whether debugging info is logged.

setShouldLogExceptions

public void setShouldLogExceptions(boolean flag)
PUBLIC: Call this method to set whether exceptions are logged.

setShouldLogExceptionStackTrace

public void setShouldLogExceptionStackTrace(boolean flag)
PUBLIC: Call this method to set whether exception stack traces are logged.

setShouldPrintDate

public void setShouldPrintDate(boolean flag)
PUBLIC: Call this method to set whether the date is logged.

setShouldPrintThread

public void setShouldPrintThread(boolean flag)
PUBLIC: Call this method to set whether the thread info is logged.

setShouldPrintConnection

public void setShouldPrintConnection(boolean flag)
PUBLIC: Call this method to set whether the connection is logged.

setShouldPrintSession

public void setShouldPrintSession(boolean flag)
PUBLIC: Call this method to set whether the session is logged.

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.

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.

Copyright © 1998, 2005 Oracle Corporation. All Rights Reserved.