|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.logging.AbstractSessionLog
org.eclipse.persistence.logging.CommonsLoggingSessionLog
public final class CommonsLoggingSessionLog
PUBLIC: This is a wrapper class for org.apache.commons.logging.Log. It is used when messages need to be logged through apache commons logging 1.1. History : - 05/05/2009 : Updated API to EclipseLink 1.1 version + Javadoc fixes - 08/05/2009 : Fix for log4j levels in conflict with eclipselink jpa levels (shouldLog) TODO : Use Enum instead of int values for Levels (OO Design) Requires : - Jakarta Commons Logging 1.1 : http://commons.apache.org/logging/ - commons-logging-1.1.1.jar - Log4j 1.2 : http://logging.apache.org/log4j/ - log4j-1.2.15.jar
AbstractSessionLog
,
JavaLog
,
SessionLogEntry
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_ECLIPSELINK_NAMESPACE
org.eclipse.persistence.default used by Log4J configuration |
static java.lang.String |
ECLIPSELINK_NAMESPACE
Stores the default session name in case there is the session name is missing. |
static boolean |
FORCE_APACHE_COMMONS_LOGGING_DIAGNOSTICS
internal apache commons Logging diagnostic FLAG : use System.out |
static boolean |
FORCE_INTERNAL_DEBUG
internal debugger FLAG : use System.out |
static boolean |
FORCE_INTERNAL_DEBUG_STACK
internal debugger FLAG : use a stack trace to find caller class |
static java.util.logging.Level[] |
JAVA_LEVELS
Stores all the java.util.logging.Levels. |
static java.lang.String |
LOGGING_LOCALIZATION_STRING
Copied from JavaLog for compatibility issues |
static java.lang.String |
SESSION_ECLIPSELINK_NAMESPACE
org.eclipse.persistence.session used by Log4J configuration |
static java.lang.String |
TRACE_LOCALIZATION_STRING
Copied from JavaLog for compatibility issues |
static int |
UNDEFINED_LEVEL
value -1 corresponds to an undefined Level |
static boolean |
USE_INTERNAL_CACHE
internal cache FLAG for LogWrapper's levels |
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 | |
---|---|
CommonsLoggingSessionLog()
PUBLIC: CommonsLoggingSessionLog Constructor. |
Method Summary | |
---|---|
java.lang.Object |
clone()
INTERNAL: Each session owns its own session log because session is stored in the session log |
protected static void |
debug(java.lang.String message)
Prints the message in Std out |
protected static void |
debug(java.lang.String message,
boolean printStack)
Prints the message in Std out |
protected static void |
error(java.lang.String message)
Prints the message in Std err |
protected static void |
error(java.lang.Throwable th)
Prints the message in Std err |
int |
getLevel(java.lang.String category)
PUBLIC: Return the effective log level for the name space extracted from session and category. |
void |
log(org.eclipse.persistence.logging.SessionLogEntry entry)
PUBLIC: Log a SessionLogEntry |
static void |
onExit()
PUBLIC: onExit method : release all ClassLoader references due to apache commons logging LogFactory NOTE : This method must be called in the context of a web application via ServletContextListener.contextDestroyed(ServletContextEvent) |
static void |
onInit()
PUBLIC: OnInit method : define system properties for org.apache.commons.logging |
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(org.eclipse.persistence.sessions.Session pSession)
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 lev 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 |
---|
public static final boolean FORCE_INTERNAL_DEBUG
public static final boolean FORCE_INTERNAL_DEBUG_STACK
public static final boolean USE_INTERNAL_CACHE
public static final boolean FORCE_APACHE_COMMONS_LOGGING_DIAGNOSTICS
public static final int UNDEFINED_LEVEL
public static final java.lang.String ECLIPSELINK_NAMESPACE
public static final java.lang.String DEFAULT_ECLIPSELINK_NAMESPACE
public static final java.lang.String SESSION_ECLIPSELINK_NAMESPACE
public static final java.lang.String LOGGING_LOCALIZATION_STRING
public static final java.lang.String TRACE_LOCALIZATION_STRING
public static final java.util.logging.Level[] JAVA_LEVELS
Constructor Detail |
---|
public CommonsLoggingSessionLog()
Method Detail |
---|
public static final void onInit()
public static final void onExit()
LogFactory.release(ClassLoader)
public final int getLevel(java.lang.String category)
getLevel
in interface org.eclipse.persistence.logging.SessionLog
getLevel
in class org.eclipse.persistence.logging.AbstractSessionLog
category
- category
public final void setLevel(int level, java.lang.String category)
setLevel
in interface org.eclipse.persistence.logging.SessionLog
setLevel
in class org.eclipse.persistence.logging.AbstractSessionLog
level
- value according to the java.util.logging.Levelscategory
- categorypublic final void setWriter(java.io.OutputStream fileOutputStream)
setWriter
in class org.eclipse.persistence.logging.AbstractSessionLog
fileOutputStream
- the file output stream will receive the formatted log entries.public final void setSession(org.eclipse.persistence.sessions.Session pSession)
setSession
in interface org.eclipse.persistence.logging.SessionLog
setSession
in class org.eclipse.persistence.logging.AbstractSessionLog
pSession
- an eclipselink Sessionpublic final boolean shouldLog(int level, java.lang.String category)
shouldLog
in interface org.eclipse.persistence.logging.SessionLog
shouldLog
in class org.eclipse.persistence.logging.AbstractSessionLog
level
- value according to the java.util.logging.Levelscategory
- category
public final void log(org.eclipse.persistence.logging.SessionLogEntry entry)
log
in interface org.eclipse.persistence.logging.SessionLog
log
in class org.eclipse.persistence.logging.AbstractSessionLog
entry
- SessionLogEntry that holds all the information for a EclipseLink logging eventpublic final void throwing(java.lang.Throwable throwable)
throwing
in interface org.eclipse.persistence.logging.SessionLog
throwing
in class org.eclipse.persistence.logging.AbstractSessionLog
throwable
- a throwablepublic final java.lang.Object clone()
clone
in interface org.eclipse.persistence.logging.SessionLog
clone
in class org.eclipse.persistence.logging.AbstractSessionLog
protected static final void debug(java.lang.String message)
message
- message to printprotected static final void debug(java.lang.String message, boolean printStack)
message
- message to printprintStack
- adds a stack trace to find caller classprotected static final void error(java.lang.String message)
message
- message to printprotected static final void error(java.lang.Throwable th)
message
- message to print
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |