Class JavaLog
- java.lang.Object
-
- org.eclipse.persistence.logging.AbstractSessionLog
-
- org.eclipse.persistence.logging.JavaLog
-
- All Implemented Interfaces:
Cloneable,SessionLog
public class JavaLog extends AbstractSessionLog
PUBLIC:This is a wrapper class for java.util.logging. It is used when messages need to be logged through java.util.logging.
- See Also:
SessionLog,AbstractSessionLog,SessionLogEntry,Session
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_TOPLINK_NAMESPACEstatic StringSESSION_TOPLINK_NAMESPACEstatic StringTOPLINK_NAMESPACEStores the default session name in case there is the session name is missing.-
Fields inherited from interface org.eclipse.persistence.logging.SessionLog
ALL, ALL_LABEL, CACHE, CONFIG, CONFIG_LABEL, CONNECTION, DBWS, DDL, DMS, EJB, EJB_OR_METADATA, EVENT, FINE, FINE_LABEL, FINER, FINER_LABEL, FINEST, FINEST_LABEL, INFO, INFO_LABEL, JPA, JPARS, loggerCatagories, METADATA, METAMODEL, MISC, MONITORING, MOXY, OFF, OFF_LABEL, PROPAGATION, PROPERTIES, QUERY, SEQUENCING, SERVER, SEVERE, SEVERE_LABEL, SQL, TRANSACTION, WARNING, WARNING_LABEL, WEAVER
-
-
Constructor Summary
Constructors Constructor Description JavaLog()INTERNAL:
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()INTERNAL: Each session owns its own session log because session is stored in the session logMapgetCategoryLoggers()INTERNAL: Return catagoryloggersintgetLevel(String category)PUBLIC:voidlog(SessionLogEntry entry)PUBLIC:voidsetLevel(int level, String category)PUBLIC:voidsetSession(Session session)PUBLIC:voidsetWriter(OutputStream fileOutputStream)PUBLIC:booleanshouldLog(int level, String category)PUBLIC:voidthrowing(Throwable throwable)PUBLIC:-
Methods inherited from class org.eclipse.persistence.logging.AbstractSessionLog
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
-
-
-
-
Field Detail
-
TOPLINK_NAMESPACE
public static final String TOPLINK_NAMESPACE
Stores the default session name in case there is the session name is missing.- See Also:
- Constant Field Values
-
DEFAULT_TOPLINK_NAMESPACE
public static final String DEFAULT_TOPLINK_NAMESPACE
- See Also:
- Constant Field Values
-
SESSION_TOPLINK_NAMESPACE
public static final String SESSION_TOPLINK_NAMESPACE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCategoryLoggers
public Map getCategoryLoggers()
INTERNAL: Return catagoryloggers
-
getLevel
public int getLevel(String category)
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:
getLevelin interfaceSessionLog- Overrides:
getLevelin classAbstractSessionLog- Parameters:
category- the string representation of a EclipseLink category, e.g. "sql", "transaction" ...- Returns:
- the effective log level.
-
setLevel
public void setLevel(int level, String category)PUBLIC:Set the log level to a logger with name space extracted from the given category.
- Specified by:
setLevelin interfaceSessionLog- Overrides:
setLevelin classAbstractSessionLog- Parameters:
level- the new log levelcategory- the string representation of an EclipseLink category, e.g. "sql", "transaction" ...
-
setWriter
public void setWriter(OutputStream fileOutputStream)
PUBLIC:Set the output stream that will receive the formatted log entries.
- Overrides:
setWriterin classAbstractSessionLog- Parameters:
fileOutputStream- the file output stream will receive the formatted log entries.
-
setSession
public void setSession(Session session)
PUBLIC:Set the session and session namespace.
- Specified by:
setSessionin interfaceSessionLog- Overrides:
setSessionin classAbstractSessionLog- Parameters:
session- a Session
-
shouldLog
public boolean shouldLog(int level, 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. Return the shouldLog for the given category from
- Specified by:
shouldLogin interfaceSessionLog- Overrides:
shouldLogin 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 void log(SessionLogEntry entry)
PUBLIC:Log a SessionLogEntry
- Specified by:
login interfaceSessionLog- Specified by:
login classAbstractSessionLog- Parameters:
entry- SessionLogEntry that holds all the information for a TopLink logging event
-
throwing
public void throwing(Throwable throwable)
PUBLIC:Log a throwable.
- Specified by:
throwingin interfaceSessionLog- Overrides:
throwingin classAbstractSessionLog- Parameters:
throwable- a throwable
-
clone
public Object clone()
INTERNAL: Each session owns its own session log because session is stored in the session log- Specified by:
clonein interfaceSessionLog- Overrides:
clonein classAbstractSessionLog
-
-