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

public abstract Class AbstractSessionLog

extends Object
implements SessionLog, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, org.eclipse.persistence.logging.SessionLog
Known Direct Subclasses
org.eclipse.persistence.logging.DefaultSessionLog, org.eclipse.persistence.logging.JavaLog, org.eclipse.persistence.platform.server.ServerLog
Imports
java.io.IOException, .OutputStream, .OutputStreamWriter, .PrintWriter, .StringWriter, .Writer, java.text.DateFormat, java.util.Date, org.eclipse.persistence.config.PersistenceUnitProperties, org.eclipse.persistence.exceptions.ValidationException, org.eclipse.persistence.internal.databaseaccess.Accessor, org.eclipse.persistence.internal.helper.ConversionManager, org.eclipse.persistence.internal.localization.LoggingLocalization, .TraceLocalization, org.eclipse.persistence.internal.security.PrivilegedAccessHelper, org.eclipse.persistence.sessions.Session

Represents the abstract log that implements all the generic logging functions. It contains a singleton SessionLog that logs messages from outside any EclipseLink session. The singleton SessionLog can also be passed to an EclipseLink session when messages are logged through that session. When JDK1.4 is used, a singleton JavaLog is created. Otherwise a singleton DefaultSessionLog is created.
See Also
SessionLog, SessionLogEntry, DefaultSessionLog, JavaLog

Field Summary

Modifier and TypeField and Description
protected static String
CONFIG_PREFIX

Represents prefix to logged config

protected static final String
CONNECTION_STRING

Connection string

protected static String
protected DateFormat
dateFormat

Format use to print the current date/time.

protected static SessionLog
defaultLog

Represents the singleton SessionLog

protected static String
FINE_PREFIX

Represents prefix to logged fine

protected static String
FINER_PREFIX

Represents prefix to logged finer

protected static String
FINEST_PREFIX

Represents prefix to logged finest

protected static String
INFO_PREFIX

Represents prefix to logged info

protected int
level

Represents the log level

protected Session
session

Represents the session that owns this SessionLog

protected static String
SEVERE_PREFIX

Represents prefix to logged severe

protected Boolean
shouldDisplayData

Used to determine if bingdparameters should be logged or hidden.

protected Boolean
shouldLogExceptionStackTrace

Allows the printing of the stack to be explicitly disabled/enabled.

protected Boolean
shouldPrintConnection

Allows the printing of the connection to be explicitly disabled/enabled.

protected Boolean
shouldPrintDate

Allows the printing of the date to be explicitly disabled/enabled.

protected Boolean
shouldPrintSession

Allows the printing of the session to be explicitly disabled/enabled.

protected Boolean
shouldPrintThread

Allows the printing of the thread to be explicitly disabled/enabled.

protected static final String
THREAD_STRING

Thread string

protected static String
WARNING_PREFIX

Represents prefix to logged warning

protected Writer
writer

Represents the writer that will receive the formatted log entries

Constructor Summary

AccessConstructor and Description
protected
AbstractSessionLog()

PUBLIC: Create a new AbstractSessionLog

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides java.lang.Object.clone.

Implements org.eclipse.persistence.logging.SessionLog.clone.

INTERNAL: Each session owns its own session log because session is stored in the session log
public void
config(String
the message key
message
)

Implements org.eclipse.persistence.logging.SessionLog.config.

PUBLIC:

This method is called when a config level message needs to be logged.

public void
fine(String
the message key
message
)

Implements org.eclipse.persistence.logging.SessionLog.fine.

PUBLIC:

This method is called when a fine level message needs to be logged.

public void
finer(String
the message key
message
)

Implements org.eclipse.persistence.logging.SessionLog.finer.

PUBLIC:

This method is called when a finer level message needs to be logged.

public void
finest(String
the message key
message
)

Implements org.eclipse.persistence.logging.SessionLog.finest.

PUBLIC:

This method is called when a finest level message needs to be logged.

protected String
formatMessage(SessionLogEntry entry)

Return the formatted message based on the information from the given SessionLogEntry.

protected String
getConnectionString(Accessor connection)

Return the specified connection information.

public DateFormat

Returns:

the date format
getDateFormat
()

PUBLIC: Return the date format to be used when printing a log entry date.

protected String
getDateString(Date date)

Return the specified date and/or time information in string.

public static int
getDefaultLoggingLevel()

Return the system default log level.

private static String

Returns:

The system default log level property value or null if no such property is set.
getDefaultLoggingLevelProperty
()

Return the system default log level property value.

public int

Returns:

the log level
getLevel
()

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

PUBLIC:

Return the log level.

public int

Returns:

the log level
getLevel
(String
the string representation of a EclipseLink category, e.g. "sql", "transaction" ...
category
)

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

PUBLIC:

Return the log level for the category name space.

public String
getLevelString()

Implements org.eclipse.persistence.logging.SessionLog.getLevelString.

PUBLIC:

Return the log level as a string value.

public static SessionLog

Returns:

the singleton SessionLog
getLog
()

PUBLIC:

Return the singleton SessionLog.

public Session

Returns:

session
getSession
()

Implements org.eclipse.persistence.logging.SessionLog.getSession.

PUBLIC:

Get the session.

protected String
getSessionString(Session session)

Return the current session including the type and id.

protected String
getSupplementDetailString(SessionLogEntry entry)

Return the supplement detail information including date, session, thread, connection, source class name and source method name.

protected String
getThreadString(Thread thread)

Return the specified thread information.

public Writer

Returns:

the log writer
getWriter
()

Implements org.eclipse.persistence.logging.SessionLog.getWriter.

PUBLIC:

Return the writer that will receive the formatted log entries.

public void
info(String
the message key
message
)

Implements org.eclipse.persistence.logging.SessionLog.info.

PUBLIC:

This method is called when a info level message needs to be logged.

public boolean
isOff()

INTERNAL: Check if the log level is set to off.

public void
log(int
the log request level value
level
,
String
the string message - this should not be a bundle key
message
)

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

PUBLIC:

Log a message that does not need to be translated.

public void
log(int
the log request level value
level
,
String
the string message
message
,
Object
a parameter of the message
param
)

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

PUBLIC:

Log a message with one parameter that needs to be translated.

public void
log(int
the log request level value
level
,
String category, String
the string message
message
,
Object
a parameter of the message
param
)

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

PUBLIC:

Log a message with one parameter that needs to be translated.

public void
log(int
the log request level value
level
,
String
the string message
message
,
Object
a parameter of the message
param1
,
Object
second parameter of the message
param2
)

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

PUBLIC:

Log a message with two parameters that needs to be translated.

public void
log(int
the log request level value
level
,
String category, String
the string message
message
,
Object
a parameter of the message
param1
,
Object
second parameter of the message
param2
)

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

PUBLIC:

Log a message with two parameters that needs to be translated.

public void
log(int
the log request level value
level
,
String
the string message
message
,
Object
a parameter of the message
param1
,
Object
second parameter of the message
param2
,
Object
third parameter of the message
param3
)

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

PUBLIC:

Log a message with three parameters that needs to be translated.

public void
log(int
the log request level value
level
,
String category, String
the string message
message
,
Object
a parameter of the message
param1
,
Object
second parameter of the message
param2
,
Object
third parameter of the message
param3
)

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

PUBLIC:

Log a message with three parameters that needs to be translated.

public void
log(int
the log request level value
level
,
String
the string message
message
,
Object
a parameter of the message
param1
,
Object
second parameter of the message
param2
,
Object
third parameter of the message
param3
,
Object
third parameter of the message
param4
)

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

PUBLIC:

Log a message with four parameters that needs to be translated.

public void
log(int
the log request level value
level
,
String category, String
the string message
message
,
Object
a parameter of the message
param1
,
Object
second parameter of the message
param2
,
Object
third parameter of the message
param3
,
Object
third parameter of the message
param4
)

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

PUBLIC:

Log a message with four parameters that needs to be translated.

public void
log(int
the log request level value
level
,
String
the string message
message
,
Object[]
array of parameters to the message
params
)

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

PUBLIC:

Log a message with an array of parameters that needs to be translated.

public void
log(int
the log request level value
level
,
String category, String
the string message
message
,
Object[]
array of parameters to the message
params
)

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

PUBLIC:

Log a message with an array of parameters that needs to be translated.

public void
log(int
the log request level
level
,
String
the string message
message
,
Object[]
array of parameters to the message
params
,
boolean
true if the message needs to be translated
shouldTranslate
)

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

PUBLIC:

Log a message.

public void
log(int
the log request level
level
,
String
the log category
category
,
String
the string message
message
,
Object[]
array of parameters to the message
params
,
boolean
true if the message needs to be translated
shouldTranslate
)

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

PUBLIC:

Log a message.

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

Redeclares org.eclipse.persistence.logging.SessionLog.log.

PUBLIC:

Log a SessionLogEntry

public void
logThrowable(int
the log request level value
level
,
Throwable
a Throwable
throwable
)

Implements org.eclipse.persistence.logging.SessionLog.logThrowable.

PUBLIC:

Log a throwable with level.

public void
logThrowable(int
the log request level value
level
,
String category, Throwable
a Throwable
throwable
)

Implements org.eclipse.persistence.logging.SessionLog.logThrowable.

PUBLIC:

Log a throwable with level.

protected void
printPrefixString(int level, String category)

Print the prefix string representing EclipseLink logging

public void
setDateFormat(DateFormat
java.text.DateFormat
dateFormat
)

PUBLIC: Set the date format to be used when printing a log entry date.

public void
setLevel(int
the new log level
level
)

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

PUBLIC:

Set the log level.

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

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

PUBLIC:

Set the log level for the category name space.

public static void
setLog(SessionLog
a SessionLog
sessionLog
)

PUBLIC:

Set the singleton SessionLog.

public void
setSession(Session
a Session
session
)

Implements org.eclipse.persistence.logging.SessionLog.setSession.

PUBLIC:

Set the session.

public void
setShouldDisplayData(Boolean shouldDisplayData)

Implements org.eclipse.persistence.logging.SessionLog.setShouldDisplayData.

PUBLIC: Set whether bind parameters should be displayed when logging SQL.
public void
setShouldLogExceptionStackTrace(boolean shouldLogExceptionStackTrace)

Implements org.eclipse.persistence.logging.SessionLog.setShouldLogExceptionStackTrace.

By default the stack is logged for FINER or less (finest).
public void
setShouldPrintConnection(boolean shouldPrintConnection)

Implements org.eclipse.persistence.logging.SessionLog.setShouldPrintConnection.

By default the connection is printed, this can be turned off.
public void
setShouldPrintDate(boolean shouldPrintDate)

Implements org.eclipse.persistence.logging.SessionLog.setShouldPrintDate.

By default the date is always printed, but can be turned off.
public void
setShouldPrintSession(boolean shouldPrintSession)

Implements org.eclipse.persistence.logging.SessionLog.setShouldPrintSession.

By default the session (and its connection is available) are printed, this can be turned off.
public void
setShouldPrintThread(boolean shouldPrintThread)

Implements org.eclipse.persistence.logging.SessionLog.setShouldPrintThread.

By default the thread is logged for FINE or less (finer,etc.).
public void
setWriter(Writer
the log writer
writer
)

Implements org.eclipse.persistence.logging.SessionLog.setWriter.

PUBLIC:

Set the writer that will receive the formatted log entries.

public void
setWriter(OutputStream
the log writer
outputstream
)

PUBLIC:

Set the writer that will receive the formatted log entries.

public void
severe(String
the message key
message
)

Implements org.eclipse.persistence.logging.SessionLog.severe.

PUBLIC:

This method is called when a severe level message needs to be logged.

public boolean
shouldDisplayData()

Implements org.eclipse.persistence.logging.SessionLog.shouldDisplayData.

PUBLIC: Return true if SQL logging should log visible bind parameters.
public boolean

Returns:

true if the given message level will be logged
shouldLog
(int
the log request level
level
)

Implements org.eclipse.persistence.logging.SessionLog.shouldLog.

PUBLIC:

Check if a message of the given level would actually be logged.

public boolean

Returns:

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

Implements org.eclipse.persistence.logging.SessionLog.shouldLog.

PUBLIC:

Check if a message of the given level would actually be logged for the category name space.

public boolean
shouldLogExceptionStackTrace()

Implements org.eclipse.persistence.logging.SessionLog.shouldLogExceptionStackTrace.

By default the stack is logged for FINER or less (finest).
public boolean
shouldPrintConnection()

Implements org.eclipse.persistence.logging.SessionLog.shouldPrintConnection.

By default the connection is printed, this can be turned off.
public boolean
shouldPrintDate()

Implements org.eclipse.persistence.logging.SessionLog.shouldPrintDate.

By default the date is always printed, but can be turned off.
public boolean
shouldPrintSession()

Implements org.eclipse.persistence.logging.SessionLog.shouldPrintSession.

By default the session (and its connection is available) are printed, this can be turned off.
public boolean
shouldPrintThread()

Implements org.eclipse.persistence.logging.SessionLog.shouldPrintThread.

By default the thread is logged for FINE or less (finer,etc.).
public void
throwing(Throwable
a Throwable
throwable
)

Implements org.eclipse.persistence.logging.SessionLog.throwing.

PUBLIC:

Log a throwable at FINER level.

public static String
translateLoggingLevelToString(final int loggingLevel)

INTERNAL: Translate the string value of the log level to the constant value.

public static int
translateStringToLoggingLevel(String loggingLevel)

INTERNAL: Translate the string value of the log level to the constant value.

public void
warning(String
the message key
message
)

Implements org.eclipse.persistence.logging.SessionLog.warning.

PUBLIC:

This method is called when a warning level message needs to be logged.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait