public class JavaLog extends AbstractSessionLog
This is a wrapper class for java.util.logging. It is used when messages need to be logged through java.util.logging.
SessionLog
, AbstractSessionLog
, SessionLogEntry
, Session
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_TOPLINK_NAMESPACE |
static java.lang.String |
SESSION_TOPLINK_NAMESPACE |
static java.lang.String |
TOPLINK_NAMESPACE
Stores the default session name in case there is the session name is missing.
|
ALL, ALL_LABEL, CACHE, CONFIG, CONFIG_LABEL, CONNECTION, DDL, DMS, EJB, EJB_OR_METADATA, EVENT, FINE, FINE_LABEL, FINER, FINER_LABEL, FINEST, FINEST_LABEL, INFO, INFO_LABEL, JPA, JPARS, loggerCatagories, METADATA, METAMODEL, MONITORING, OFF, OFF_LABEL, PROPAGATION, PROPERTIES, QUERY, SEQUENCING, SERVER, SEVERE, SEVERE_LABEL, SQL, TRANSACTION, WARNING, WARNING_LABEL, WEAVER
Constructor and Description |
---|
JavaLog()
INTERNAL:
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
INTERNAL: Each session owns its own session log because session is stored in the session log
|
java.util.Map |
getCategoryLoggers()
INTERNAL: Return catagoryloggers
|
int |
getLevel(java.lang.String category)
PUBLIC: Return the effective log level for the name space extracted from session and category.
|
void |
log(SessionLogEntry entry)
PUBLIC: Log a SessionLogEntry
|
void |
setLevel(int level, java.lang.String category)
PUBLIC: Set the log level to a logger with name space extracted from the given category.
|
void |
setSession(Session session)
PUBLIC: Set the session and session namespace.
|
void |
setWriter(java.io.OutputStream fileOutputStream)
PUBLIC: Set the output stream that will receive the formatted log entries.
|
boolean |
shouldLog(int level, java.lang.String category)
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.
|
void |
throwing(java.lang.Throwable throwable)
PUBLIC: Log a throwable.
|
config, fine, finer, finest, getDateFormat, getDefaultLoggingLevel, getLevel, getLevelString, getLog, getSession, getWriter, info, isOff, log, log, log, log, log, log, log, log, log, log, log, log, log, logThrowable, logThrowable, setDateFormat, setLevel, setLog, setShouldDisplayData, setShouldLogExceptionStackTrace, setShouldPrintConnection, setShouldPrintDate, setShouldPrintSession, setShouldPrintThread, setWriter, severe, shouldDisplayData, shouldLog, shouldLogExceptionStackTrace, shouldPrintConnection, shouldPrintDate, shouldPrintSession, shouldPrintThread, translateLoggingLevelToString, translateStringToLoggingLevel, warning
public static final java.lang.String TOPLINK_NAMESPACE
public static final java.lang.String DEFAULT_TOPLINK_NAMESPACE
public static final java.lang.String SESSION_TOPLINK_NAMESPACE
public java.util.Map getCategoryLoggers()
public int getLevel(java.lang.String category)
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.
getLevel
in interface SessionLog
getLevel
in class AbstractSessionLog
category
- the string representation of a EclipseLink category, e.g. "sql", "transaction" ...public void setLevel(int level, java.lang.String category)
Set the log level to a logger with name space extracted from the given category.
setLevel
in interface SessionLog
setLevel
in class AbstractSessionLog
level
- the new log levelcategory
- the string representation of an EclipseLink category, e.g. "sql", "transaction" ...public void setWriter(java.io.OutputStream fileOutputStream)
Set the output stream that will receive the formatted log entries.
setWriter
in class AbstractSessionLog
fileOutputStream
- the file output stream will receive the formatted log entries.public void setSession(Session session)
Set the session and session namespace.
setSession
in interface SessionLog
setSession
in class AbstractSessionLog
session
- a Sessionpublic boolean shouldLog(int level, java.lang.String category)
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
shouldLog
in interface SessionLog
shouldLog
in class AbstractSessionLog
level
- the log request levelcategory
- the string representation of an EclipseLink category, e.g. "sql", "transaction" ...*public void log(SessionLogEntry entry)
Log a SessionLogEntry
log
in interface SessionLog
log
in class AbstractSessionLog
entry
- SessionLogEntry that holds all the information for a TopLink logging eventpublic void throwing(java.lang.Throwable throwable)
Log a throwable.
throwing
in interface SessionLog
throwing
in class AbstractSessionLog
throwable
- a throwablepublic java.lang.Object clone()
clone
in interface SessionLog
clone
in class AbstractSessionLog