- All Implemented Interfaces:
Cloneable
,SessionLog
This is a wrapper class for java.util.logging. It is used when messages need to be logged through java.util.logging.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
protected static final String
static final String
static final String
Stores the default session name in case there is the session name is missing.protected static final String
Fields 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 TypeMethodDescriptionprotected void
INTERNAL: Add Logger to the categoryloggers.clone()
INTERNAL: Each session owns its own session log because session is stored in the session logINTERNAL: Return catagoryloggersprotected Level
getJavaLevel
(int level) INTERNAL: Return the corresponding java.util.logging.Level for a given TopLink level.int
PUBLIC:protected Logger
INTERNAL: Return the Logger for the given categoryprotected String
getNameSpaceString
(String category) INTERNAL: Return the name space for the given category from the map.protected void
internalLog
(SessionLogEntry entry, Level javaLevel, Logger logger) INTERNAL:void
log
(SessionLogEntry entry) PUBLIC:void
PUBLIC:void
setSession
(Session session) PUBLIC:void
setWriter
(OutputStream fileOutputStream) PUBLIC:boolean
PUBLIC:void
PUBLIC:Methods inherited from class org.eclipse.persistence.logging.AbstractSessionLog
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, setShouldDisplayData, setShouldLogExceptionStackTrace, setShouldPrintConnection, setShouldPrintDate, setShouldPrintSession, setShouldPrintThread, setWriter, severe, shouldDisplayData, shouldLog, shouldLogExceptionStackTrace, shouldPrintConnection, shouldPrintDate, shouldPrintSession, shouldPrintThread, translateLoggingLevelToString, translateStringToLoggingLevel, warning
-
Field Details
-
TOPLINK_NAMESPACE
Stores the default session name in case there is the session name is missing.- See Also:
-
LOGGING_LOCALIZATION_STRING
- See Also:
-
TRACE_LOCALIZATION_STRING
- See Also:
-
DEFAULT_TOPLINK_NAMESPACE
- See Also:
-
SESSION_TOPLINK_NAMESPACE
- See Also:
-
-
Constructor Details
-
JavaLog
public JavaLog()INTERNAL:
-
-
Method Details
-
addLogger
INTERNAL: Add Logger to the categoryloggers. -
getCategoryLoggers
INTERNAL: Return catagoryloggers -
getLevel
PUBLIC:Return the effective log level for the name space extracted from session and category. If a Logger's level is set to be null then the Logger will use an effective Level that will be obtained by walking up the parent tree and using the first non-null Level.
- Specified by:
getLevel
in interfaceSessionLog
- Overrides:
getLevel
in classAbstractSessionLog
- Parameters:
category
- the string representation of a EclipseLink category, e.g. "sql", "transaction" ...- Returns:
- the effective log level.
-
setLevel
PUBLIC:Set the log level to a logger with name space extracted from the given category.
- 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" ...
-
setWriter
PUBLIC:Set the output stream that will receive the formatted log entries.
- Overrides:
setWriter
in classAbstractSessionLog
- Parameters:
fileOutputStream
- the file output stream will receive the formatted log entries.
-
getNameSpaceString
INTERNAL: Return the name space for the given category from the map. -
getLogger
INTERNAL: Return the Logger for the given category -
setSession
PUBLIC:Set the session and session namespace.
- Specified by:
setSession
in interfaceSessionLog
- Overrides:
setSession
in classAbstractSessionLog
- Parameters:
session
- a Session
-
getJavaLevel
INTERNAL: Return the corresponding java.util.logging.Level for a given TopLink level. -
shouldLog
PUBLIC: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. Return the shouldLog for the given category from
- 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
-
log
PUBLIC:Log a SessionLogEntry
- Specified by:
log
in interfaceSessionLog
- Specified by:
log
in classAbstractSessionLog
- Parameters:
entry
- SessionLogEntry that holds all the information for a TopLink logging event
-
internalLog
INTERNAL:Build a LogRecord
- Parameters:
entry
- SessionLogEntry that holds all the information for a TopLink logging eventjavaLevel
- the message level
-
throwing
PUBLIC:Log a throwable.
- Specified by:
throwing
in interfaceSessionLog
- Overrides:
throwing
in classAbstractSessionLog
- Parameters:
throwable
- a throwable
-
clone
INTERNAL: Each session owns its own session log because session is stored in the session log- Specified by:
clone
in interfaceSessionLog
- Overrides:
clone
in classAbstractSessionLog
-