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 String |
DEFAULT_TOPLINK_NAMESPACE |
protected static String |
LOGGING_LOCALIZATION_STRING |
static String |
SESSION_TOPLINK_NAMESPACE |
static String |
TOPLINK_NAMESPACE
Stores the default session name in case there is the session name is missing.
|
protected static String |
TRACE_LOCALIZATION_STRING |
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
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, TRANSACTION, WARNING, WARNING_LABEL, WEAVER
Constructor and Description |
---|
JavaLog()
INTERNAL:
|
Modifier and Type | Method and Description |
---|---|
protected void |
addLogger(String loggerCategory,
String loggerNameSpace)
INTERNAL:
Add Logger to the categoryloggers.
|
Object |
clone()
INTERNAL:
Each session owns its own session log because session is stored in the session log
|
Map |
getCategoryLoggers()
INTERNAL:
Return catagoryloggers
|
protected Level |
getJavaLevel(int level)
INTERNAL:
Return the corresponding java.util.logging.Level for a given TopLink level.
|
int |
getLevel(String category)
PUBLIC:
|
protected Logger |
getLogger(String category)
INTERNAL:
Return the Logger for the given category
|
protected 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 |
setLevel(int level,
String category)
PUBLIC:
|
void |
setSession(Session session)
PUBLIC:
|
void |
setWriter(OutputStream fileOutputStream)
PUBLIC:
|
boolean |
shouldLog(int level,
String category)
PUBLIC:
|
void |
throwing(Throwable throwable)
PUBLIC:
|
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
public static final String TOPLINK_NAMESPACE
protected static final String LOGGING_LOCALIZATION_STRING
protected static final String TRACE_LOCALIZATION_STRING
public static final String DEFAULT_TOPLINK_NAMESPACE
public static final String SESSION_TOPLINK_NAMESPACE
protected void addLogger(String loggerCategory, String loggerNameSpace)
public Map getCategoryLoggers()
public int getLevel(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, 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(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.
protected String getNameSpaceString(String category)
protected Logger getLogger(String category)
public void setSession(Session session)
Set the session and session namespace.
setSession
in interface SessionLog
setSession
in class AbstractSessionLog
session
- a Sessionprotected Level getJavaLevel(int level)
public boolean shouldLog(int level, 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 event
protected void internalLog(SessionLogEntry entry, Level javaLevel, Logger logger)
Build a LogRecord
entry
- SessionLogEntry that holds all the information for a TopLink logging eventjavaLevel
- the message level
public void throwing(Throwable throwable)
Log a throwable.
throwing
in interface SessionLog
throwing
in class AbstractSessionLog
throwable
- a throwable
public Object clone()
clone
in interface SessionLog
clone
in class AbstractSessionLog
Copyright © 2007–2021 Eclipse.org - EclipseLink Project. All rights reserved.