Top Description Fields Methods
org.eclipse.persistence.logging

public Interface SessionLog

extends Cloneable
Known Direct Implementers
org.eclipse.persistence.logging.AbstractSessionLog
Imports
java.io.Writer, org.eclipse.persistence.sessions.Session

SessionLog is the ever-so-simple interface used by EclipseLink to log generated messages and SQL. An implementor of this interface can be passed to the EclipseLink session (via the #setSessionLog(SessionLog) method); and all logging data will be passed through to the implementor via an instance of SessionLogEntry. This can be used to supplement debugging; or the entries could be stored in a database instead of logged to System.out, etc.

This class defines EclipseLink logging levels (that are used throughout EclipseLink code) with the following integer values:

Logging levels
 ALL  = 0
 FINEST  = 1
 FINER  = 2
 FINE  = 3
 CONFIG  = 4
 INFO  = 5
 WARNING = 6
 SEVERE  = 7
 OFF  = 8

In addition, EclipseLink categories used for logging name space are defined with the following String values:

Logging categories
 CACHE  = cache
 CONNECTION  = connection
 DMS  = dms
 EJB  = ejb
 EVENT  = event
 DBWS  = dbws
 JPARS  = jpars
 METADATA  = metadata
 METAMODEL  = metamodel
 MOXY  = moxy
 PROCESSOR  = processor
 PROPAGATION  = propagation
 PROPERTIES  = properties
 QUERY  = query
 SEQUENCING  = sequencing
 SERVER  = server
 SQL  = sql
 THREAD  = thread
 TRANSACTION  = transaction
 WEAVER  = weaver
Since
TOPLink/Java 3.0
See Also
AbstractSessionLog, SessionLogEntry, Session

Field Summary

Modifier and TypeField and Description
public static final int
public static final String
public static final String
public static final int
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final int
public static final String
public static final int
public static final String
public static final int
public static final String
public static final int
public static final String
public static final String
public static final String
public static final String[]
public static final String
public static final String
public static final String
public static final String
public static final String
public static final int
public static final String
public static final String
PROCESSOR

ModelGen logging name space.

public static final String
public static final String
public static final String
public static final String
public static final String
public static final int
public static final String
public static final String
public static final String
public static final String
public static final int
public static final String
public static final String

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

PUBLIC: Clone the log.

public void
config(String message)

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

public void
fine(String message)

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

public void
finer(String message)

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

public void
finest(String message)

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

public int
getLevel()

PUBLIC: Return the log level.

public int
getLevel(String category)

PUBLIC: Return the log level; category is only needed where name space is available.

public String
getLevelString()

PUBLIC:

Return the log level as a string value.

public Session
getSession()

PUBLIC: Get the session that owns this SessionLog.

public Writer
getWriter()

PUBLIC: Return the writer to which an accessor writes logged messages and SQL.

public void
info(String message)

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

public void
log(SessionLogEntry
org.eclipse.persistence.sessions.LogEntry
entry
)

PUBLIC: EclipseLink will call this method whenever something needs to be logged (messages, SQL, etc.).

public void
log(int level, String message)

PUBLIC: Log a message that does not need to be translated.

public void
log(int level, String message, Object param)

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

public void
log(int level, String category, String message, Object param)

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

public void
log(int level, String message, Object param1, Object param2)

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

public void
log(int level, String category, String message, Object param1, Object param2)

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

public void
log(int level, String message, Object param1, Object param2, Object param3)

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

public void
log(int level, String category, String message, Object param1, Object param2, Object param3)

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

public void
log(int level, String message, Object param1, Object param2, Object param3, Object param4)

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

public void
log(int level, String category, String message, Object param1, Object param2, Object param3, Object param4)

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

public void
log(int level, String message, Object[] arguments)

PUBLIC: This method is called when the log request is from somewhere session is not available.

public void
log(int level, String category, String message, Object[] arguments)

PUBLIC: This method is called when the log request is from somewhere session is not available.

public void
log(int level, String message, Object[] arguments, boolean shouldTranslate)

PUBLIC: This method is called when the log request is from somewhere session is not available.

public void
log(int level, String category, String message, Object[] arguments, boolean shouldTranslate)

PUBLIC: This method is called when the log request is from somewhere session is not available.

public void
logThrowable(int level, Throwable throwable)

PUBLIC: Log a Throwable with level.

public void
logThrowable(int level, String category, Throwable throwable)

PUBLIC: Log a throwable with level.

public void
setLevel(int level)

PUBLIC: Set the log level.

public void
setLevel(int level, String category)

PUBLIC: Set the log level.

public void
setSession(Session session)

PUBLIC: Set the session that owns this SessionLog.

public void
setShouldDisplayData(Boolean shouldDisplayData)

Set whether bind parameters should be displayed when logging SQL.

public void
setShouldLogExceptionStackTrace(boolean flag)

By default stack trace is logged for SEVERE all the time and at FINER level for WARNING or less.

public void
setShouldPrintConnection(boolean flag)

By default the connection is always printed whenever available, this can be turned off.

public void
setShouldPrintDate(boolean flag)

By default date is printed, this can be turned off.

public void
setShouldPrintSession(boolean flag)

By default the Session is always printed whenever available, this can be turned off.

public void
setShouldPrintThread(boolean flag)

By default the thread is logged at FINE or less level, this can be turned off.

public void
setWriter(Writer log)

PUBLIC: Set the writer to which an accessor writes logged messages and SQL.

public void
severe(String message)

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

public boolean
shouldDisplayData()

Return whether bind parameters should be displayed when logging SQL, default is true.

public boolean
shouldLog(int level)

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

public boolean
shouldLog(int level, String category)

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

public boolean
shouldLogExceptionStackTrace()

By default the stack trace is logged for SEVERE all the time and at FINER level for WARNING or less, this can be turned off.

public boolean
shouldPrintConnection()

By default the connection is always printed whenever available, this can be turned off.

public boolean
shouldPrintDate()

By default the date is always printed, this can be turned off.

public boolean
shouldPrintSession()

By default the Session is always printed whenever available, this can be turned off.

public boolean
shouldPrintThread()

By default the thread is logged at FINE or less level, this can be turned off.

public void
throwing(Throwable throwable)

PUBLIC: This method is called when a throwable at finer level needs to be logged.

public void
warning(String message)

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

Field Detail

ALLback to summary
public static final int ALL
ALL_LABELback to summary
public static final String ALL_LABEL
CACHEback to summary
public static final String CACHE
CONFIGback to summary
public static final int CONFIG
CONFIG_LABELback to summary
public static final String CONFIG_LABEL
CONNECTIONback to summary
public static final String CONNECTION
DBWSback to summary
public static final String DBWS
DDLback to summary
public static final String DDL
DMSback to summary
public static final String DMS
EJBback to summary
public static final String EJB
EVENTback to summary
public static final String EVENT
FINEback to summary
public static final int FINE
FINE_LABELback to summary
public static final String FINE_LABEL
FINERback to summary
public static final int FINER
FINER_LABELback to summary
public static final String FINER_LABEL
FINESTback to summary
public static final int FINEST
FINEST_LABELback to summary
public static final String FINEST_LABEL
INFOback to summary
public static final int INFO
INFO_LABELback to summary
public static final String INFO_LABEL
JPAback to summary
public static final String JPA
JPARSback to summary
public static final String JPARS
loggerCatagoriesback to summary
public static final String[] loggerCatagories
METADATAback to summary
public static final String METADATA
METAMODELback to summary
public static final String METAMODEL
MISCback to summary
public static final String MISC
MONITORINGback to summary
public static final String MONITORING
MOXYback to summary
public static final String MOXY
OFFback to summary
public static final int OFF
OFF_LABELback to summary
public static final String OFF_LABEL
PROCESSORback to summary
public static final String PROCESSOR

ModelGen logging name space.

PROPAGATIONback to summary
public static final String PROPAGATION
PROPERTIESback to summary
public static final String PROPERTIES
QUERYback to summary
public static final String QUERY
SEQUENCINGback to summary
public static final String SEQUENCING
SERVERback to summary
public static final String SERVER
SEVEREback to summary
public static final int SEVERE
SEVERE_LABELback to summary
public static final String SEVERE_LABEL
SQLback to summary
public static final String SQL
THREADback to summary
public static final String THREAD
TRANSACTIONback to summary
public static final String TRANSACTION
WARNINGback to summary
public static final int WARNING
WARNING_LABELback to summary
public static final String WARNING_LABEL
WEAVERback to summary
public static final String WEAVER

Method Detail

cloneback to summary
public Object clone()

PUBLIC: Clone the log.

configback to summary
public void config(String message)

PUBLIC: This method is called when a config level message needs to be logged. The message will be translated

fineback to summary
public void fine(String message)

PUBLIC: This method is called when a fine level message needs to be logged. The message will be translated

finerback to summary
public void finer(String message)

PUBLIC: This method is called when a finer level message needs to be logged. The message will be translated

finestback to summary
public void finest(String message)

PUBLIC: This method is called when a finest level message needs to be logged. The message will be translated

getLevelback to summary
public int getLevel()

PUBLIC: Return the log level. Used when session is not available.

The EclipseLink logging levels returned correspond to:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
getLevelback to summary
public int getLevel(String category)

PUBLIC: Return the log level; category is only needed where name space is available.

The EclipseLink logging levels returned correspond to:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8

The EclipseLink categories for the logging name space are:

Logging categories
 CACHE  = cache
 CONNECTION  = connection
 DMS  = dms
 EJB  = ejb
 EVENT  = event
 DBWS  = dbws
 JPARS  = jpars
 METAMODEL  = metamodel
 MOXY  = moxy
 PROCESSOR  = processor
 PROPAGATION  = propagation
 PROPERTIES  = properties
 QUERY  = query
 SEQUENCING  = sequencing
 SERVER  = server
 SQL  = sql
 THREAD  = thread
 TRANSACTION  = transaction
 WEAVER  = weaver
getLevelStringback to summary
public String getLevelString()

PUBLIC:

Return the log level as a string value.

getSessionback to summary
public Session getSession()

PUBLIC: Get the session that owns this SessionLog.

getWriterback to summary
public Writer getWriter()

PUBLIC: Return the writer to which an accessor writes logged messages and SQL. If not set, this reference usually defaults to a writer on System.out. To enable logging, logMessages must be turned on in the session.

infoback to summary
public void info(String message)

PUBLIC: This method is called when a info level message needs to be logged. The message will be translated

logback to summary
public void log(SessionLogEntry entry)

PUBLIC: EclipseLink will call this method whenever something needs to be logged (messages, SQL, etc.). All the pertinent information will be contained in the specified entry.

Parameters
entry:SessionLogEntry

org.eclipse.persistence.sessions.LogEntry

logback to summary
public void log(int level, String message)

PUBLIC: Log a message that does not need to be translated. This method is intended for external use when logging messages are wanted within the EclipseLink output.

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
logback to summary
public void log(int level, String message, Object param)

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

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
logback to summary
public void log(int level, String category, String message, Object param)

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

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
logback to summary
public void log(int level, String message, Object param1, Object param2)

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

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
logback to summary
public void log(int level, String category, String message, Object param1, Object param2)

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

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
logback to summary
public void log(int level, String message, Object param1, Object param2, Object param3)

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

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
logback to summary
public void log(int level, String category, String message, Object param1, Object param2, Object param3)

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

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
logback to summary
public void log(int level, String message, Object param1, Object param2, Object param3, Object param4)

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

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
logback to summary
public void log(int level, String category, String message, Object param1, Object param2, Object param3, Object param4)

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

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
logback to summary
public void log(int level, String message, Object[] arguments)

PUBLIC: This method is called when the log request is from somewhere session is not available. The message needs to be translated.

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
logback to summary
public void log(int level, String category, String message, Object[] arguments)

PUBLIC: This method is called when the log request is from somewhere session is not available. The message needs to be translated.

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
logback to summary
public void log(int level, String message, Object[] arguments, boolean shouldTranslate)

PUBLIC: This method is called when the log request is from somewhere session is not available. shouldTranslate flag determines if the message needs to be translated.

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
logback to summary
public void log(int level, String category, String message, Object[] arguments, boolean shouldTranslate)

PUBLIC: This method is called when the log request is from somewhere session is not available. shouldTranslate flag determines if the message needs to be translated.

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
logThrowableback to summary
public void logThrowable(int level, Throwable throwable)

PUBLIC: Log a Throwable with level.

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
logThrowableback to summary
public void logThrowable(int level, String category, Throwable throwable)

PUBLIC: Log a throwable with level.

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
setLevelback to summary
public void setLevel(int level)

PUBLIC: Set the log level. Used when session is not available.

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
setLevelback to summary
public void setLevel(int level, String category)

PUBLIC: Set the log level. Category is only needed where name space is available.

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8

The EclipseLink categories for the logging name space are:

Logging categories
 CACHE  = cache
 CONNECTION  = connection
 DMS  = dms
 EJB  = ejb
 EVENT  = event
 DBWS  = dbws
 JPARS  = jpars
 METAMODEL  = metamodel
 MOXY  = moxy
 PROCESSOR  = processor
 PROPAGATION  = propagation
 PROPERTIES  = properties
 QUERY  = query
 SEQUENCING  = sequencing
 SERVER  = server
 SQL  = sql
 THREAD  = thread
 TRANSACTION  = transaction
 WEAVER  = weaver
setSessionback to summary
public void setSession(Session session)

PUBLIC: Set the session that owns this SessionLog.

setShouldDisplayDataback to summary
public void setShouldDisplayData(Boolean shouldDisplayData)

Set whether bind parameters should be displayed when logging SQL.

setShouldLogExceptionStackTraceback to summary
public void setShouldLogExceptionStackTrace(boolean flag)

By default stack trace is logged for SEVERE all the time and at FINER level for WARNING or less. This can be turned off.

setShouldPrintConnectionback to summary
public void setShouldPrintConnection(boolean flag)

By default the connection is always printed whenever available, this can be turned off.

setShouldPrintDateback to summary
public void setShouldPrintDate(boolean flag)

By default date is printed, this can be turned off.

setShouldPrintSessionback to summary
public void setShouldPrintSession(boolean flag)

By default the Session is always printed whenever available, this can be turned off.

setShouldPrintThreadback to summary
public void setShouldPrintThread(boolean flag)

By default the thread is logged at FINE or less level, this can be turned off.

setWriterback to summary
public void setWriter(Writer log)

PUBLIC: Set the writer to which an accessor writes logged messages and SQL. If not set, this reference usually defaults to a writer on System.out. To enable logging, logMessages() is used on the session.

severeback to summary
public void severe(String message)

PUBLIC: This method is called when a severe level message needs to be logged. The message will be translated

shouldDisplayDataback to summary
public boolean shouldDisplayData()

Return whether bind parameters should be displayed when logging SQL, default is true.

shouldLogback to summary
public boolean shouldLog(int level)

PUBLIC: Check if a message of the given level would actually be logged. Used when session is not available.

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8
shouldLogback to summary
public boolean shouldLog(int level, String category)

PUBLIC: Check if a message of the given level would actually be logged. Category is only needed where name space is available.

The EclipseLink logging levels available are:

Logging levels
ALL  = 0
FINEST  = 1
FINER  = 2
FINE  = 3
CONFIG  = 4
INFO  = 5
WARNING = 6
SEVERE  = 7
OFF  = 8

The EclipseLink categories for the logging name space are:

Logging categories
 CACHE  = cache
 CONNECTION  = connection
 DMS  = dms
 EJB  = ejb
 EVENT  = event
 DBWS  = dbws
 JPARS  = jpars
 METAMODEL  = metamodel
 MOXY  = moxy
 PROCESSOR  = processor
 PROPAGATION  = propagation
 PROPERTIES  = properties
 QUERY  = query
 SEQUENCING  = sequencing
 SERVER  = server
 SQL  = sql
 THREAD  = thread
 TRANSACTION  = transaction
 WEAVER  = weaver
shouldLogExceptionStackTraceback to summary
public boolean shouldLogExceptionStackTrace()

By default the stack trace is logged for SEVERE all the time and at FINER level for WARNING or less, this can be turned off.

shouldPrintConnectionback to summary
public boolean shouldPrintConnection()

By default the connection is always printed whenever available, this can be turned off.

shouldPrintDateback to summary
public boolean shouldPrintDate()

By default the date is always printed, this can be turned off.

shouldPrintSessionback to summary
public boolean shouldPrintSession()

By default the Session is always printed whenever available, this can be turned off.

shouldPrintThreadback to summary
public boolean shouldPrintThread()

By default the thread is logged at FINE or less level, this can be turned off.

throwingback to summary
public void throwing(Throwable throwable)

PUBLIC: This method is called when a throwable at finer level needs to be logged.

warningback to summary
public void warning(String message)

PUBLIC: This method is called when a warning level message needs to be logged. The message will be translated