Oracle Application Server TopLink API Reference
10g (9.0.4)

B10491-01

oracle.toplink.sessions
Class DefaultSessionLog

java.lang.Object
  |
  +--oracle.toplink.sessions.DefaultSessionLog
All Implemented Interfaces:
java.io.Serializable, SessionLog

public class DefaultSessionLog
extends java.lang.Object
implements SessionLog, java.io.Serializable

Purpose: Default log used for the session when message logging is enabled. The session can log information such as,

As well information about the message can be logged such as,

See Also:
SessionLog, DefaultSessionLog, Session.logMessage(String), Serialized Form

Constructor Summary
DefaultSessionLog()
          PUBLIC: Create a new default session log.
DefaultSessionLog(java.io.Writer writer)
          PUBLIC: Create a new default session log for the given writer.

 

Method Summary
 void dontLogDebug()
          PUBLIC: Set debug messages logging off.
 void dontLogExceptions()
          PUBLIC: Set exceptions logging off.
 void dontLogExceptionStackTrace()
          PUBLIC: Set the exception's stack trace not to be logged.
 void dontPrintConnection()
          PUBLIC: Configure the log to NOT print the connection.
 void dontPrintDate()
          PUBLIC: Configure the log to NOT print the date and/or time.
 void dontPrintSession()
          PUBLIC: Configure the log to NOT print the session.
 void dontPrintThread()
          PUBLIC: Configure the log to NOT print the thread.
 java.text.DateFormat getDateFormat()
          PUBLIC: Return the date format to be used when printing a log entry date.
 java.io.Writer getWriter()
          PUBLIC: Return the writer that will receive the formatted log entries.
 java.lang.String getWriterFilename()
          PUBLIC: For the given writer, return it's associated filename.
 void log(SessionLogEntry entry)
          PUBLIC: Log the entry.
 void logDebug()
          PUBLIC: Set debug messages logging.
 void logExceptions()
          PUBLIC: Set exceptions logging.
 void logExceptionStackTrace()
          PUBLIC: Set the exception's stack trace to be logged.
 void printConnection()
          PUBLIC: Configure the log to print the connection.
 void printDate()
          PUBLIC: Configure the log to print the date and/or time.
 void printSession()
          PUBLIC: Configure the log to print the session.
 void printThread()
          PUBLIC: Configure the log to print the thread.
 void setDateFormat(java.text.DateFormat dateFormat)
          PUBLIC: Set the date format to be used when printing a log entry date.
 void setShouldLogDebug(boolean shouldLogDebug)
          PUBLIC: Set debug messages logging.
 void setShouldLogExceptions(boolean shouldLogExceptions)
          PUBLIC: Set exceptions logging.
 void setShouldLogExceptionStackTrace(boolean shouldLogExceptionStackTrace)
          PUBLIC: Set if the exception's stack trace should be logged.
 void setShouldPrintConnection(boolean shouldPrintConnection)
          PUBLIC: Set whether the log should print the connection.
 void setShouldPrintDate(boolean shouldPrintDate)
          PUBLIC: Set whether the log should print the date and/or time.
 void setShouldPrintSession(boolean shouldPrintSession)
          PUBLIC: Set whether the log should print the session.
 void setShouldPrintThread(boolean shouldPrintThread)
          PUBLIC: Set whether the log should print the thread.
 void setWriter(java.lang.String aFileName)
          PUBLIC: Set the writer that will receive the formatted log entries for a file name.
 void setWriter(java.io.Writer writer)
          PUBLIC: Set the writer that will receive the formatted log entries.
 boolean shouldLogDebug()
          PUBLIC: Return if debug messages should be logged.
 boolean shouldLogExceptions()
          PUBLIC: Return if exceptions should be logged.
 boolean shouldLogExceptionStackTrace()
          PUBLIC: Return if the exception's stack trace should be logged.
 boolean shouldPrintConnection()
          PUBLIC: Return whether the log should print the connection.
 boolean shouldPrintDate()
          PUBLIC: Return whether the log should print the date and/or time.
 boolean shouldPrintSession()
          PUBLIC: Return whether the log should print the session.
 boolean shouldPrintThread()
          PUBLIC: Return whether the log should print the thread.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

DefaultSessionLog

public DefaultSessionLog()
PUBLIC: Create a new default session log.

DefaultSessionLog

public DefaultSessionLog(java.io.Writer writer)
PUBLIC: Create a new default session log for the given writer.
Method Detail

dontLogDebug

public void dontLogDebug()
PUBLIC: Set debug messages logging off.

dontLogExceptions

public void dontLogExceptions()
PUBLIC: Set exceptions logging off.

dontLogExceptionStackTrace

public void dontLogExceptionStackTrace()
PUBLIC: Set the exception's stack trace not to be logged.

dontPrintConnection

public void dontPrintConnection()
PUBLIC: Configure the log to NOT print the connection.

dontPrintDate

public void dontPrintDate()
PUBLIC: Configure the log to NOT print the date and/or time.

dontPrintSession

public void dontPrintSession()
PUBLIC: Configure the log to NOT print the session.

dontPrintThread

public void dontPrintThread()
PUBLIC: Configure the log to NOT print the thread.

getDateFormat

public java.text.DateFormat getDateFormat()
PUBLIC: Return the date format to be used when printing a log entry date.
Returns:
the date format

getWriter

public java.io.Writer getWriter()
PUBLIC: Return the writer that will receive the formatted log entries.
Specified by:
getWriter in interface SessionLog
Returns:
the log writer

log

public void log(SessionLogEntry entry)
PUBLIC: Log the entry. This writes the log entries information to a writer such as System.out or a file. This must be synchronized as it will be called by many threads in three-tier.
Specified by:
log in interface SessionLog
Parameters:
entry - oracle.toplink.sessions.LogEntry

logDebug

public void logDebug()
PUBLIC: Set debug messages logging. Debug messages will be dumped through TopLink to the session's log. By default this is System.out, but can be set to any Writer.

logExceptions

public void logExceptions()
PUBLIC: Set exceptions logging.

logExceptionStackTrace

public void logExceptionStackTrace()
PUBLIC: Set the exception's stack trace to be logged.

printConnection

public void printConnection()
PUBLIC: Configure the log to print the connection.

printDate

public void printDate()
PUBLIC: Configure the log to print the date and/or time.

printSession

public void printSession()
PUBLIC: Configure the log to print the session.

printThread

public void printThread()
PUBLIC: Configure the log to print the thread.

setDateFormat

public void setDateFormat(java.text.DateFormat dateFormat)
PUBLIC: Set the date format to be used when printing a log entry date.
Parameters:
dateFormat - java.text.DateFormat

setShouldLogDebug

public void setShouldLogDebug(boolean shouldLogDebug)
PUBLIC: Set debug messages logging. Debug messages will be dumped through TopLink to the session's log. By default this is System.out, but can be set to any Writer.
Specified by:
setShouldLogDebug in interface SessionLog

setShouldLogExceptions

public void setShouldLogExceptions(boolean shouldLogExceptions)
PUBLIC: Set exceptions logging. Exceptions will be dumped through TopLink to the session's log. By default this is System.out, but can be set to any Writer.
Specified by:
setShouldLogExceptions in interface SessionLog

setShouldLogExceptionStackTrace

public void setShouldLogExceptionStackTrace(boolean shouldLogExceptionStackTrace)
PUBLIC: Set if the exception's stack trace should be logged. This is true by default if exception logging is on.
Specified by:
setShouldLogExceptionStackTrace in interface SessionLog

setShouldPrintConnection

public void setShouldPrintConnection(boolean shouldPrintConnection)
PUBLIC: Set whether the log should print the connection.
Specified by:
setShouldPrintConnection in interface SessionLog

setShouldPrintDate

public void setShouldPrintDate(boolean shouldPrintDate)
PUBLIC: Set whether the log should print the date and/or time.
Specified by:
setShouldPrintDate in interface SessionLog

setShouldPrintSession

public void setShouldPrintSession(boolean shouldPrintSession)
PUBLIC: Set whether the log should print the session.
Specified by:
setShouldPrintSession in interface SessionLog

setShouldPrintThread

public void setShouldPrintThread(boolean shouldPrintThread)
PUBLIC: Set whether the log should print the thread.
Specified by:
setShouldPrintThread in interface SessionLog

setWriter

public void setWriter(java.io.Writer writer)
PUBLIC: Set the writer that will receive the formatted log entries.
Specified by:
setWriter in interface SessionLog
Parameters:
writer - java.io.Writer

setWriter

public void setWriter(java.lang.String aFileName)
PUBLIC: Set the writer that will receive the formatted log entries for a file name.

getWriterFilename

public java.lang.String getWriterFilename()
PUBLIC: For the given writer, return it's associated filename. If associated writer does not have a filename, return null.

shouldLogDebug

public boolean shouldLogDebug()
PUBLIC: Return if debug messages should be logged.
Specified by:
shouldLogDebug in interface SessionLog

shouldLogExceptions

public boolean shouldLogExceptions()
PUBLIC: Return if exceptions should be logged.
Specified by:
shouldLogExceptions in interface SessionLog

shouldLogExceptionStackTrace

public boolean shouldLogExceptionStackTrace()
PUBLIC: Return if the exception's stack trace should be logged. This is true by default if exception logging is on.
Specified by:
shouldLogExceptionStackTrace in interface SessionLog

shouldPrintConnection

public boolean shouldPrintConnection()
PUBLIC: Return whether the log should print the connection.
Specified by:
shouldPrintConnection in interface SessionLog

shouldPrintDate

public boolean shouldPrintDate()
PUBLIC: Return whether the log should print the date and/or time.
Specified by:
shouldPrintDate in interface SessionLog

shouldPrintSession

public boolean shouldPrintSession()
PUBLIC: Return whether the log should print the session.
Specified by:
shouldPrintSession in interface SessionLog

shouldPrintThread

public boolean shouldPrintThread()
PUBLIC: Return whether the log should print the thread.
Specified by:
shouldPrintThread in interface SessionLog

Copyright © 2003 Oracle Corporation. All Rights Reserved.