Top Description Fields Constructors Methods
org.eclipse.persistence.logging

public Class DefaultSessionLog

extends AbstractSessionLog
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.FileWriter, .IOException, .PrintWriter, .Serializable, .Writer, java.util.HashMap, .Map, org.eclipse.persistence.exceptions.ValidationException, org.eclipse.persistence.internal.helper.Helper

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

Field Summary

Modifier and TypeField and Description
private final Map<String, Integer>
categoryLogLevelMap

Represents the Map that stores log levels per the name space strings.

protected String
fileName

The filename associated with this DefaultSessionLog, if it is being written out to a file

Inherited from org.eclipse.persistence.logging.AbstractSessionLog:
CONFIG_PREFIXCONNECTION_STRINGDATE_FORMAT_STRdateFormatdefaultLogFINE_PREFIXFINER_PREFIXFINEST_PREFIXINFO_PREFIXlevelsessionSEVERE_PREFIXshouldDisplayDatashouldLogExceptionStackTraceshouldPrintConnectionshouldPrintDateshouldPrintSessionshouldPrintThreadTHREAD_STRINGTOPLINK_PREFIXWARNING_PREFIXwriter

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public int
getLevel(String
the string representation of a EclipseLink category, e.g. "sql", "transaction" ...
category
)

Overrides org.eclipse.persistence.logging.AbstractSessionLog.getLevel.

Implements org.eclipse.persistence.logging.SessionLog.getLevel.

PUBLIC:

Return the log level for the category name space.

public String
getWriterFilename()

For the given writer, return it's associated filename.

protected void
initialize()

Initialize the log to be backward-compatible with the original TopLink log.

protected void
initialize(Writer writer)

Initialize the log.

public void
log(SessionLogEntry
SessionLogEntry that holds all the information for an EclipseLink logging event
entry
)

Implements abstract org.eclipse.persistence.logging.AbstractSessionLog.log.

Implements org.eclipse.persistence.logging.SessionLog.log.

Log the entry.
public void
setLevel(int
the new log level
level
,
String
the string representation of an EclipseLink category, e.g. "sql", "transaction" ...
category
)

Overrides org.eclipse.persistence.logging.AbstractSessionLog.setLevel.

Implements org.eclipse.persistence.logging.SessionLog.setLevel.

PUBLIC:

Set the log level for the category name space.

public void
setWriter(String aFileName)

Set the writer that will receive the formatted log entries for a file name.

public boolean

Returns:

true if the given message level will be logged for the given category
shouldLog
(int
the log request level
level
,
String
the string representation of an EclipseLink category, e.g. "sql", "transaction" ...*
category
)

Overrides org.eclipse.persistence.logging.AbstractSessionLog.shouldLog.

Implements org.eclipse.persistence.logging.SessionLog.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.
protected void
writeMessage(String message)

Append the specified message information to the writer.

protected void
writeSeparator()

Append the separator string to the writer.

Inherited from org.eclipse.persistence.logging.AbstractSessionLog:
cloneconfigfinefinerfinestformatMessagegetConnectionStringgetDateFormatgetDateStringgetDefaultLoggingLevelgetLevelgetLevelStringgetLoggetSessiongetSessionStringgetSupplementDetailStringgetThreadStringgetWriterinfoisOffloglogloglogloglogloglogloglogloglogloglogThrowablelogThrowableprintPrefixStringsetDateFormatsetLevelsetLogsetSessionsetShouldDisplayDatasetShouldLogExceptionStackTracesetShouldPrintConnectionsetShouldPrintDatesetShouldPrintSessionsetShouldPrintThreadsetWritersetWritersevereshouldDisplayDatashouldLogshouldLogExceptionStackTraceshouldPrintConnectionshouldPrintDateshouldPrintSessionshouldPrintThreadthrowingtranslateLoggingLevelToStringtranslateStringToLoggingLevelwarning

Field Detail

categoryLogLevelMapback to summary
private final Map<String, Integer> categoryLogLevelMap

Represents the Map that stores log levels per the name space strings. The keys are category names. The values are log levels.

fileNameback to summary
protected String fileName

The filename associated with this DefaultSessionLog, if it is being written out to a file

Constructor Detail

DefaultSessionLogback to summary
public DefaultSessionLog()
DefaultSessionLogback to summary
public DefaultSessionLog(Writer writer)

Method Detail

getLevelback to summary
public int getLevel(String category)

Overrides org.eclipse.persistence.logging.AbstractSessionLog.getLevel.

Implements org.eclipse.persistence.logging.SessionLog.getLevel.

Doc from org.eclipse.persistence.logging.AbstractSessionLog.getLevel.

PUBLIC:

Return the log level for the category name space.

Parameters
category:String

the string representation of a EclipseLink category, e.g. "sql", "transaction" ...

Returns:int

the log level

Annotations
@Override
getWriterFilenameback to summary
public String getWriterFilename()

For the given writer, return it's associated filename. If associated writer does not have a filename, return null.

initializeback to summary
protected void initialize()

Initialize the log to be backward-compatible with the original TopLink log.

initializeback to summary
protected void initialize(Writer writer)

Initialize the log.

logback to summary
public void log(SessionLogEntry entry)

Implements abstract org.eclipse.persistence.logging.AbstractSessionLog.log.

Implements org.eclipse.persistence.logging.SessionLog.log.

Log the entry. This writes the log entries information to a writer such as System.out or a file.

Parameters
entry:SessionLogEntry

Doc from org.eclipse.persistence.logging.AbstractSessionLog.log.

SessionLogEntry that holds all the information for an EclipseLink logging event

Annotations
@Override
setLevelback to summary
public void setLevel(int level, String category)

Overrides org.eclipse.persistence.logging.AbstractSessionLog.setLevel.

Implements org.eclipse.persistence.logging.SessionLog.setLevel.

Doc from org.eclipse.persistence.logging.AbstractSessionLog.setLevel.

PUBLIC:

Set the log level for the category name space.

Parameters
level:int

the new log level

category:String

the string representation of an EclipseLink category, e.g. "sql", "transaction" ...

Annotations
@Override
setWriterback to summary
public void setWriter(String aFileName)

Set the writer that will receive the formatted log entries for a file name.

shouldLogback to summary
public boolean shouldLog(int level, String category)

Overrides org.eclipse.persistence.logging.AbstractSessionLog.shouldLog.

Implements org.eclipse.persistence.logging.SessionLog.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.

Parameters
level:int

Doc from org.eclipse.persistence.logging.AbstractSessionLog.shouldLog.

the log request level

category:String

Doc from org.eclipse.persistence.logging.AbstractSessionLog.shouldLog.

the string representation of an EclipseLink category, e.g. "sql", "transaction" ...*

Returns:boolean

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

Annotations
@Override
writeMessageback to summary
protected void writeMessage(String message) throws IOException

Append the specified message information to the writer.

writeSeparatorback to summary
protected void writeSeparator() throws IOException

Append the separator string to the writer.