Package org.eclipse.persistence.logging
Class DefaultSessionLog
java.lang.Object
org.eclipse.persistence.logging.AbstractSessionLog
org.eclipse.persistence.logging.DefaultSessionLog
- All Implemented Interfaces:
Serializable
,Cloneable
,SessionLog
Purpose: Default log used for the session when message logging is
enabled. The session can log information such as,
- all SQL executed
- informational messages
- debugging information
- all exceptions that occur within TopLink
- the session logging the message
- the connection executing the SQL
- the thread in which the log entry occurred
- the exact time (to milliseconds) that the log entry occurred
- the stack trace to the exception
- See Also:
- Author:
- Big Country
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
The filename associated with this DefaultSessionLog, if it is being written out to a fileFields inherited from class org.eclipse.persistence.logging.AbstractSessionLog
CONFIG_PREFIX, CONNECTION_STRING, DATE_FORMAT_STR, dateFormat, defaultLog, FINE_PREFIX, FINER_PREFIX, FINEST_PREFIX, INFO_PREFIX, level, session, SEVERE_PREFIX, shouldDisplayData, shouldLogExceptionStackTrace, shouldPrintConnection, shouldPrintDate, shouldPrintSession, shouldPrintThread, THREAD_STRING, TOPLINK_PREFIX, WARNING_PREFIX, writer
Fields inherited from interface org.eclipse.persistence.logging.SessionLog
ALL, ALL_LABEL, CACHE, CONFIG, CONFIG_LABEL, CONNECTION, DBWS, DDL, DMS, EJB, EVENT, FINE, FINE_LABEL, FINER, FINER_LABEL, FINEST, FINEST_LABEL, INFO, INFO_LABEL, JPA, JPARS, loggerCatagories, METADATA, METAMODEL, MISC, MONITORING, MOXY, OFF, OFF_LABEL, PROCESSOR, PROPAGATION, PROPERTIES, QUERY, SEQUENCING, SERVER, SEVERE, SEVERE_LABEL, SQL, THREAD, TRANSACTION, WARNING, WARNING_LABEL, WEAVER
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
PUBLIC:For the given writer, return it's associated filename.protected void
Initialize the log to be backward-compatible with the original TopLink log.protected void
initialize
(Writer writer) Initialize the log.void
log
(SessionLogEntry entry) Log the entry.void
PUBLIC:void
Set the writer that will receive the formatted log entries for a file name.boolean
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.protected void
writeMessage
(String message) Append the specified message information to the writer.protected void
Append the separator string to the writer.Methods inherited from class org.eclipse.persistence.logging.AbstractSessionLog
clone, config, fine, finer, finest, formatMessage, getConnectionString, getDateFormat, getDateString, getDefaultLoggingLevel, getLevel, getLevelString, getLog, getSession, getSessionString, getSupplementDetailString, getThreadString, getWriter, info, isOff, log, log, log, log, log, log, log, log, log, log, log, log, log, logThrowable, logThrowable, printPrefixString, setDateFormat, setLevel, setLog, setSession, setShouldDisplayData, setShouldLogExceptionStackTrace, setShouldPrintConnection, setShouldPrintDate, setShouldPrintSession, setShouldPrintThread, setWriter, setWriter, severe, shouldDisplayData, shouldLog, shouldLogExceptionStackTrace, shouldPrintConnection, shouldPrintDate, shouldPrintSession, shouldPrintThread, throwing, translateLoggingLevelToString, translateStringToLoggingLevel, warning
-
Field Details
-
fileName
The filename associated with this DefaultSessionLog, if it is being written out to a file
-
-
Constructor Details
-
DefaultSessionLog
public DefaultSessionLog() -
DefaultSessionLog
-
-
Method Details
-
setLevel
Description copied from class:AbstractSessionLog
PUBLIC:Set the log level for the category name space.
- Specified by:
setLevel
in interfaceSessionLog
- Overrides:
setLevel
in classAbstractSessionLog
- Parameters:
level
- the new log levelcategory
- the string representation of an EclipseLink category, e.g. "sql", "transaction" ...
-
getLevel
Description copied from class:AbstractSessionLog
PUBLIC:Return the log level for the category name space.
- Specified by:
getLevel
in interfaceSessionLog
- Overrides:
getLevel
in classAbstractSessionLog
- Parameters:
category
- the string representation of a EclipseLink category, e.g. "sql", "transaction" ...- Returns:
- the log level
-
shouldLog
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 interfaceSessionLog
- Overrides:
shouldLog
in classAbstractSessionLog
- Parameters:
level
- the log request levelcategory
- the string representation of an EclipseLink category, e.g. "sql", "transaction" ...*- Returns:
- true if the given message level will be logged for the given category
-
initialize
protected void initialize()Initialize the log to be backward-compatible with the original TopLink log. -
initialize
Initialize the log. -
log
Log the entry. This writes the log entries information to a writer such as System.out or a file.- Specified by:
log
in interfaceSessionLog
- Specified by:
log
in classAbstractSessionLog
- Parameters:
entry
- SessionLogEntry that holds all the information for an EclipseLink logging event
-
setWriter
Set the writer that will receive the formatted log entries for a file name. -
getWriterFilename
For the given writer, return it's associated filename. If associated writer does not have a filename, return null. -
writeMessage
Append the specified message information to the writer.- Throws:
IOException
-
writeSeparator
Append the separator string to the writer.- Throws:
IOException
-