java.lang.Object
org.eclipse.persistence.logging.SessionLogEntry
- All Implemented Interfaces:
Serializable
SessionLogEntry is a simple container object that holds
all the information pertinent to an EclipseLink logging event.
It has a time stamp indicating when the event took
place. It holds the session, thread, and accessor
responsible for the event. And it holds whatever message
was passed through to be logged.
- Since:
- TOPLink/Java 3.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intDeprecated, for removal: This API element is subject to removal in a future version.Use getLevel() insteadprotected StringDeprecated, for removal: This API element is subject to removal in a future version.Use getMessage() insteadprotected StringDeprecated, for removal: This API element is subject to removal in a future version.Use getNameSpace() insteadprotected Object[]Deprecated, for removal: This API element is subject to removal in a future version.Use getParameters() insteadprotected booleanDeprecated, for removal: This API element is subject to removal in a future version.Will be removed from the class, translation will not be part of the loggerprotected StringDeprecated, for removal: This API element is subject to removal in a future version.Use getSourceClassName() insteadprotected StringDeprecated, for removal: This API element is subject to removal in a future version.Use getSourceMethodName() insteadprotected ThreadDeprecated, for removal: This API element is subject to removal in a future version.Use getThread() insteadprotected ThrowableDeprecated, for removal: This API element is subject to removal in a future version.Use getException() instead -
Constructor Summary
ConstructorsConstructorDescriptionSessionLogEntry(int level, String category, String sessionId, String message, Object[] params, Integer connectionId, boolean shouldTranslate) Deprecated, for removal: This API element is subject to removal in a future version.Translation will not be part of the logger,shouldTranslatewill be removedSessionLogEntry(int level, String category, String sessionId, String message, Throwable throwable) Creates a new session log entry for the specified log level, category, session, message, and throwable. -
Method Summary
Modifier and TypeMethodDescriptionReturn the datasource connection identifier that generated the log entry.Return the exception that caused the log entry.intgetLevel()Return the request level of the log entry.Return the log entry's message.Return the name space of the log entry.Object[]Return the session identifier that generated the log entry.Return the thread that was active when the log entry was generated.booleanbooleanvoidsetException(Throwable throwable) Set the exception that caused the log entry.voidsetLevel(int level) Set the request level of the log entry.voidsetMessage(String message) Set the entry's message.voidsetNameSpace(String nameSpace) Set the name space of the log entry.voidsetParameters(Object[] params) Set the array of parameters to the message.voidsetSessionId(String sessionId) Set the session identifier that generated the log entry.voidsetShouldTranslate(boolean shouldTranslate) Deprecated, for removal: This API element is subject to removal in a future version.Will be removed from the class, translation will not be part of the loggervoidsetSourceClassName(String sourceClassName) Set the source class name to the message.voidsetSourceMethodName(String sourceMethodName) Set the source method name to the message.voidSet the thread that was active when the log entry was generated.voidsetTimeStamp(Instant timeStamp) booleanDeprecated, for removal: This API element is subject to removal in a future version.Will be removed from the class, translation will not be part of the loggertoString()
-
Field Details
-
thread
Deprecated, for removal: This API element is subject to removal in a future version.Use getThread() instead -
message
Deprecated, for removal: This API element is subject to removal in a future version.Use getMessage() instead -
throwable
Deprecated, for removal: This API element is subject to removal in a future version.Use getException() instead -
level
Deprecated, for removal: This API element is subject to removal in a future version.Use getLevel() instead -
nameSpace
Deprecated, for removal: This API element is subject to removal in a future version.Use getNameSpace() instead -
parameters
Deprecated, for removal: This API element is subject to removal in a future version.Use getParameters() instead -
shouldTranslate
Deprecated, for removal: This API element is subject to removal in a future version.Will be removed from the class, translation will not be part of the logger -
sourceClassName
Deprecated, for removal: This API element is subject to removal in a future version.Use getSourceClassName() instead -
sourceMethodName
Deprecated, for removal: This API element is subject to removal in a future version.Use getSourceMethodName() instead
-
-
Constructor Details
-
SessionLogEntry
@Deprecated(forRemoval=true, since="4.0.9") public SessionLogEntry(int level, String category, String sessionId, String message, Object[] params, Integer connectionId, boolean shouldTranslate) Deprecated, for removal: This API element is subject to removal in a future version.Translation will not be part of the logger,shouldTranslatewill be removedCreate a new session log entry for the specified log level, category, session, message, parameters, and datasource connection identifier.The log entry is created with the current thread and timestamp. The exception associated with the log entry is set to null.
- Parameters:
level- the log level of the entrycategory- the category of the log entrysessionId- the identifier of the session that generated the log entrymessage- the log messageparams- an array of parameters associated with the log messageconnectionId- the identifier of the datasource connection that generated the log entryshouldTranslate- whether the log message should be translated- See Also:
-
SessionLogEntry
public SessionLogEntry(int level, String category, String sessionId, String message, Throwable throwable) Creates a new session log entry for the specified log level, category, session, message, and throwable.The log entry is created with the current thread and timestamp. The category is set to the provided category, and the parameters are set to an empty array. The log message is set to the provided message.
The log message is not translated by default.
- Parameters:
level- the log level of the entrycategory- the category of the log entrysessionId- the identifier of the session that generated the log entrymessage- the log messagethrowable- the exception that caused the log entry- See Also:
-
-
Method Details
-
getConnectionId
Return the datasource connection identifier that generated the log entry.- Returns:
- the datasource connection identifier
-
getTimeStamp
-
getException
Return the exception that caused the log entry.- Returns:
- the exception
-
getMessage
Return the log entry's message.- Returns:
- the message
-
getSessionId
Return the session identifier that generated the log entry.- Returns:
- the session identifier
-
getThread
Return the thread that was active when the log entry was generated.- Returns:
- the thread
-
getLevel
public int getLevel()Return the request level of the log entry.
Possible values for log level are listed in SessionLog.- Returns:
- the request level of the log entry
- See Also:
-
getNameSpace
Return the name space of the log entry.
Possible values for log category (a String) are listed in SessionLog.- Returns:
- the name space of the log entry
- See Also:
-
getParameters
- Returns:
- the array of parameters to the message.
-
getSourceClassName
- Returns:
- the source class name to the message
-
getSourceMethodName
- Returns:
- the source method name to the message
-
shouldTranslate
Deprecated, for removal: This API element is subject to removal in a future version.Will be removed from the class, translation will not be part of the logger- Returns:
- if the message should be translated.
-
hasException
public boolean hasException()- Returns:
- if the log entry was for an exception.
-
hasMessage
public boolean hasMessage()- Returns:
- if the log entry has a message
-
setTimeStamp
-
setException
Set the exception that caused the log entry.- Parameters:
throwable- the exception
-
setMessage
Set the entry's message.- Parameters:
message- the message
-
setSessionId
Set the session identifier that generated the log entry.- Parameters:
sessionId- the session identifier
-
setThread
Set the thread that was active when the log entry was generated.- Parameters:
thread- the thread
-
setLevel
public void setLevel(int level) Set the request level of the log entry.
Possible values for log level are listed in SessionLog.- Parameters:
level- the log level- See Also:
-
setNameSpace
Set the name space of the log entry.
Possible values for log category (a String) are listed in SessionLog.- Parameters:
nameSpace- the log category- See Also:
-
setParameters
Set the array of parameters to the message.- Parameters:
params- array of parameters
-
setShouldTranslate
Deprecated, for removal: This API element is subject to removal in a future version.Will be removed from the class, translation will not be part of the loggerSet if the message should be translated.- Parameters:
shouldTranslate- true if the message should be translated, false otherwise
-
setSourceClassName
Set the source class name to the message.- Parameters:
sourceClassName- source class name
-
setSourceMethodName
Set the source method name to the message.- Parameters:
sourceMethodName- source method name
-
toString
-