org.eclipse.persistence.logging
Class DefaultSessionLog

java.lang.Object
  extended by org.eclipse.persistence.logging.AbstractSessionLog
      extended by org.eclipse.persistence.logging.DefaultSessionLog
All Implemented Interfaces:
Serializable, Cloneable, SessionLog

public class DefaultSessionLog
extends AbstractSessionLog
implements 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,

Author:
Big Country
See Also:
SessionLog, AbstractSessionLog, Serialized Form

Field Summary
 
Fields inherited from interface org.eclipse.persistence.logging.SessionLog
ALL, ALL_LABEL, CACHE, CONFIG, CONFIG_LABEL, CONNECTION, DMS, EJB, EJB_OR_METADATA, EVENT, FINE, FINE_LABEL, FINER, FINER_LABEL, FINEST, FINEST_LABEL, INFO, INFO_LABEL, loggerCatagories, METAMODEL, OFF, OFF_LABEL, PROPAGATION, PROPERTIES, QUERY, SEQUENCING, SERVER, SEVERE, SEVERE_LABEL, SQL, TRANSACTION, WARNING, WARNING_LABEL, WEAVER
 
Constructor Summary
DefaultSessionLog()
          PUBLIC: Create a new default session log.
DefaultSessionLog(Writer writer)
          PUBLIC: Create a new default session log for the given writer.
 
Method Summary
 int getLevel(String category)
          PUBLIC:
 String getWriterFilename()
          PUBLIC: For the given writer, return it's associated filename.
 void log(SessionLogEntry entry)
          PUBLIC: Log the entry.
 void setLevel(int level, String category)
          PUBLIC:
 void setWriter(String aFileName)
          PUBLIC: Set the writer that will receive the formatted log entries for a file name.
 boolean shouldLog(int level, String category)
          PUBLIC:
 
Methods inherited from class org.eclipse.persistence.logging.AbstractSessionLog
clone, config, fine, finer, finest, getDateFormat, getDefaultLoggingLevel, getLevel, getLevelString, getLog, getSession, getWriter, info, isOff, log, log, log, log, log, log, logThrowable, setDateFormat, setLevel, setLog, setSession, setShouldLogExceptionStackTrace, setShouldPrintConnection, setShouldPrintDate, setShouldPrintSession, setShouldPrintThread, setWriter, setWriter, severe, shouldLog, shouldLogExceptionStackTrace, shouldPrintConnection, shouldPrintDate, shouldPrintSession, shouldPrintThread, throwing, translateLoggingLevelToString, translateStringToLoggingLevel, warning
 
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(Writer writer)
PUBLIC: Create a new default session log for the given writer.

Method Detail

setLevel

public void setLevel(int level,
                     String category)
Description copied from class: AbstractSessionLog
PUBLIC:

Set the log level for the category name space.

Specified by:
setLevel in interface SessionLog
Overrides:
setLevel in class AbstractSessionLog
Parameters:
level - the new log level
category - the string representation of a TopLink category, e.g. "sql", "transaction" ...


getLevel

public int getLevel(String category)
Description copied from class: AbstractSessionLog
PUBLIC:

Return the log level for the category name space.

Specified by:
getLevel in interface SessionLog
Overrides:
getLevel in class AbstractSessionLog
Parameters:
category - the string representation of a TopLink category, e.g. "sql", "transaction" ...

Returns:
the log level


shouldLog

public boolean shouldLog(int level,
                         String category)
PUBLIC:

Check if a message of the given level would actually be logged by the logger with name space built from the given session and category.

Specified by:
shouldLog in interface SessionLog
Overrides:
shouldLog in class AbstractSessionLog
Parameters:
level - the log request level
category - the string representation of a TopLink category, e.g. "sql", "transaction" ...*

Returns:
true if the given message level will be logged for the given category


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.

Specified by:
log in interface SessionLog
Specified by:
log in class AbstractSessionLog
Parameters:
entry - org.eclipse.persistence.sessions.LogEntry

setWriter

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


getWriterFilename

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