Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

E28847-01


org.eclipse.persistence.logging
Class JavaLog

java.lang.Object
  extended by org.eclipse.persistence.logging.AbstractSessionLog
      extended by org.eclipse.persistence.logging.JavaLog

All Implemented Interfaces:
java.lang.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
private  java.util.Map categoryloggers
           
static java.lang.String DEFAULT_TOPLINK_NAMESPACE
           
private static java.util.logging.Level[] levels
          Stores all the java.util.logging.Levels.
protected static java.lang.String LOGGING_LOCALIZATION_STRING
           
private  java.util.Map nameSpaceMap
          Represents the HashMap that stores all the name space strings.
static java.lang.String SESSION_TOPLINK_NAMESPACE
           
private  java.util.logging.Logger sessionLogger
          Stores the Logger for session namespace, i.e.
private  java.lang.String sessionNameSpace
          Stores the namespace for session, i.e."
static java.lang.String TOPLINK_NAMESPACE
          Stores the default session name in case there is the session name is missing.
protected static java.lang.String TRACE_LOCALIZATION_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, DMS, EJB, EJB_OR_METADATA, EVENT, FINE, FINE_LABEL, FINER, FINER_LABEL, FINEST, FINEST_LABEL, INFO, INFO_LABEL, loggerCatagories, METAMODEL, OFF, OFF_LABEL, PROPAGATION, PROPERTIES, QUERY, SEQUENCING, SERVER, SEVERE, SEVERE_LABEL, SQL, TRANSACTION, WARNING, WARNING_LABEL, WEAVER

 

Constructor Summary
JavaLog()
          INTERNAL:

 

Method Summary
protected  void addLogger(java.lang.String loggerCategory, java.lang.String loggerNameSpace)
          INTERNAL: Add Logger to the catagoryloggers.
 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
protected  java.util.logging.Level getJavaLevel(int level)
          INTERNAL: Return the corresponding java.util.logging.Level for a given TopLink level.
 int getLevel(java.lang.String category)
          PUBLIC: Return the effective log level for the name space extracted from session and category.
protected  java.util.logging.Logger getLogger(java.lang.String category)
          INTERNAL: Return the Logger for the given category
protected  java.lang.String getNameSpaceString(java.lang.String category)
          INTERNAL: Return the name space for the given category from the map.
protected  void internalLog(SessionLogEntry entry, java.util.logging.Level javaLevel, java.util.logging.Logger logger)
          INTERNAL: Build a LogRecord
 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.

 

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, logThrowable, printPrefixString, setDateFormat, setLevel, setLog, setShouldDisplayData, setShouldLogExceptionStackTrace, setShouldPrintConnection, setShouldPrintDate, setShouldPrintSession, setShouldPrintThread, setWriter, severe, shouldDisplayData, shouldLog, shouldLogExceptionStackTrace, shouldPrintConnection, shouldPrintDate, shouldPrintSession, shouldPrintThread, translateLoggingLevelToString, translateStringToLoggingLevel, warning

 

Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

TOPLINK_NAMESPACE

public static final java.lang.String TOPLINK_NAMESPACE
Stores the default session name in case there is the session name is missing.
See Also:
Constant Field Values

LOGGING_LOCALIZATION_STRING

protected static final java.lang.String LOGGING_LOCALIZATION_STRING
See Also:
Constant Field Values

TRACE_LOCALIZATION_STRING

protected static final java.lang.String TRACE_LOCALIZATION_STRING
See Also:
Constant Field Values

DEFAULT_TOPLINK_NAMESPACE

public static final java.lang.String DEFAULT_TOPLINK_NAMESPACE
See Also:
Constant Field Values

SESSION_TOPLINK_NAMESPACE

public static final java.lang.String SESSION_TOPLINK_NAMESPACE
See Also:
Constant Field Values

levels

private static final java.util.logging.Level[] levels
Stores all the java.util.logging.Levels. The indexes are TopLink logging levels.

nameSpaceMap

private java.util.Map nameSpaceMap
Represents the HashMap that stores all the name space strings. The keys are category names. The values are namespace strings.

sessionNameSpace

private java.lang.String sessionNameSpace
Stores the namespace for session, i.e."org.eclipse.persistence.session.<sessionname>".

sessionLogger

private java.util.logging.Logger sessionLogger
Stores the Logger for session namespace, i.e. "org.eclipse.persistence.session.<sessionname>".

categoryloggers

private java.util.Map categoryloggers

Constructor Detail

JavaLog

public JavaLog()
INTERNAL:

Method Detail

addLogger

protected void addLogger(java.lang.String loggerCategory,
                         java.lang.String loggerNameSpace)
INTERNAL: Add Logger to the catagoryloggers.

getCategoryLoggers

public java.util.Map getCategoryLoggers()
INTERNAL: Return catagoryloggers

getLevel

public int getLevel(java.lang.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:
getLevel in interface SessionLog
Overrides:
getLevel in class AbstractSessionLog
Parameters:
category - the string representation of a EclipseLink category, e.g. "sql", "transaction" ...
Returns:
the effective log level.

setLevel

public void setLevel(int level,
                     java.lang.String category)
PUBLIC:

Set the log level to a logger with name space extracted from the given category.

Specified by:
setLevel in interface SessionLog
Overrides:
setLevel in class AbstractSessionLog
Parameters:
level - the new log level
category - the string representation of an EclipseLink category, e.g. "sql", "transaction" ...

setWriter

public void setWriter(java.io.OutputStream fileOutputStream)
PUBLIC:

Set the output stream that will receive the formatted log entries.

Overrides:
setWriter in class AbstractSessionLog
Parameters:
fileOutputStream - the file output stream will receive the formatted log entries.

getNameSpaceString

protected java.lang.String getNameSpaceString(java.lang.String category)
INTERNAL: Return the name space for the given category from the map.

getLogger

protected java.util.logging.Logger getLogger(java.lang.String category)
INTERNAL: Return the Logger for the given category

setSession

public void setSession(Session session)
PUBLIC:

Set the session and session namespace.

Specified by:
setSession in interface SessionLog
Overrides:
setSession in class AbstractSessionLog
Parameters:
session - a Session

getJavaLevel

protected java.util.logging.Level getJavaLevel(int level)
INTERNAL: Return the corresponding java.util.logging.Level for a given TopLink level.

shouldLog

public 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. Return the shouldLog for the given category from

Specified by:
shouldLog in interface SessionLog
Overrides:
shouldLog in class AbstractSessionLog
Parameters:
level - the log request level
category - 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:
log in interface SessionLog
Specified by:
log in class AbstractSessionLog
Parameters:
entry - SessionLogEntry that holds all the information for a TopLink logging event

internalLog

protected void internalLog(SessionLogEntry entry,
                           java.util.logging.Level javaLevel,
                           java.util.logging.Logger logger)
INTERNAL:

Build a LogRecord

Parameters:
entry - SessionLogEntry that holds all the information for a TopLink logging event
javaLevel - the message level

throwing

public void throwing(java.lang.Throwable throwable)
PUBLIC:

Log a throwable.

Specified by:
throwing in interface SessionLog
Overrides:
throwing in class AbstractSessionLog
Parameters:
throwable - a throwable

clone

public java.lang.Object clone()
INTERNAL: Each session owns its own session log because session is stored in the session log
Specified by:
clone in interface SessionLog
Overrides:
clone in class AbstractSessionLog

Skip navigation links

Copyright © 1998, 2012, Oracle. All Rights Reserved.