|
Oracle Fusion Middleware Java API Reference for Oracle TopLink 11g Release 1 (11.1.1) B32476-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.toplink.logging.AbstractSessionLog
public abstract class AbstractSessionLog
Represents the abstract log that implements all the generic logging functions. It contains a singleton SessionLog that logs messages from outside any TopLink session. The singleton SessionLog can also be passed to a TopLink session when messages are logged through that session. When JDK1.4 is used, a singleton JavaLog is created. Otherwise a singleton DefaultSessionLog is created.
SessionLog
,
SessionLogEntry
,
DefaultSessionLog
,
JavaLog
Field Summary |
---|
Fields inherited from interface oracle.toplink.logging.SessionLog |
---|
ALL, ALL_LABEL, CONFIG, CONFIG_LABEL, FINE, FINE_LABEL, FINER, FINER_LABEL, FINEST, FINEST_LABEL, INFO, INFO_LABEL, OFF_LABEL, SEVERE, SEVERE_LABEL, WARNING, WARNING_LABEL |
Fields inherited from interface oracle.toplink.sessions.SessionLog |
---|
CACHE, CONNECTION, DMS, EJB, EJB_OR_METADATA, EVENT, loggerCatagories, OFF, PROPAGATION, PROPERTIES, QUERY, SEQUENCING, SERVER, SQL, TRANSACTION, WEAVER |
Constructor Summary | |
---|---|
AbstractSessionLog()
Create a new AbstractSessionLog |
Method Summary | |
---|---|
void |
config(java.lang.String message)
This method is called when a config level message needs to be logged. |
void |
fine(java.lang.String message)
This method is called when a fine level message needs to be logged. |
void |
finer(java.lang.String message)
This method is called when a finer level message needs to be logged. |
void |
finest(java.lang.String message)
This method is called when a finest level message needs to be logged. |
java.text.DateFormat |
getDateFormat()
Return the date format to be used when printing a log entry date. |
static int |
getDefaultLoggingLevel()
Return the system default log level. |
int |
getLevel()
Return the log level. |
int |
getLevel(java.lang.String category)
Return the log level for the category name space. |
java.lang.String |
getLevelString()
Return the log level as a string value. |
static SessionLog |
getLog()
Return the singleton SessionLog. |
Session |
getSession()
Get the session. |
java.io.Writer |
getWriter()
Return the writer that will receive the formatted log entries. |
void |
info(java.lang.String message)
This method is called when a info level message needs to be logged. |
void |
log(int level,
java.lang.String message)
Log a message that does not need to be translated. |
void |
log(int level,
java.lang.String message,
java.lang.Object param)
Log a message with one parameter that needs to be translated. |
void |
log(int level,
java.lang.String message,
java.lang.Object[] params)
Log a message with an array of parameters that needs to be translated. |
void |
log(int level,
java.lang.String message,
java.lang.Object[] params,
boolean shouldTranslate)
Log a message. |
void |
log(int level,
java.lang.String message,
java.lang.Object param1,
java.lang.Object param2)
Log a message with two parameters that needs to be translated. |
void |
log(int level,
java.lang.String message,
java.lang.Object param1,
java.lang.Object param2,
java.lang.Object param3)
Log a message with three parameters that needs to be translated. |
abstract void |
log(SessionLogEntry sessionLogEntry)
Log a SessionLogEntry |
void |
log(SessionLogEntry entry)
Deprecated. replaced by log(oracle.toplink.logging.SessionLogEntry) |
void |
logThrowable(int level,
java.lang.Throwable throwable)
Log a throwable with level. |
void |
setDateFormat(java.text.DateFormat dateFormat)
Set the date format to be used when printing a log entry date. |
void |
setLevel(int level)
Set the log level. |
void |
setLevel(int level,
java.lang.String category)
Set the log level for the category name space. |
static void |
setLog(SessionLog sessionLog)
Set the singleton SessionLog. |
void |
setSession(Session session)
Set the session. |
void |
setShouldLogDebug(boolean shouldLogDebug)
Deprecated. replaced by level |
void |
setShouldLogExceptions(boolean shouldLogExceptions)
Deprecated. replaced by level |
void |
setShouldLogExceptionStackTrace(boolean shouldLogExceptionStackTrace)
By default the stack is logged for FINER or less (finest). |
void |
setShouldPrintConnection(boolean shouldPrintConnection)
By default the connection is printed, this can be turned off. |
void |
setShouldPrintDate(boolean shouldPrintDate)
By default the date is always printed, but can be turned off. |
void |
setShouldPrintSession(boolean shouldPrintSession)
By default the session (and its connection is available) are printed, this can be turned off. |
void |
setShouldPrintThread(boolean shouldPrintThread)
By default the thread is logged for FINE or less (finer,etc.). |
void |
setWriter(java.io.OutputStream outputstream)
Set the writer that will receive the formatted log entries. |
void |
setWriter(java.io.Writer writer)
Set the writer that will receive the formatted log entries. |
void |
severe(java.lang.String message)
This method is called when a severe level message needs to be logged. |
boolean |
shouldLog(int level)
Check if a message of the given level would actually be logged. |
boolean |
shouldLog(int level,
java.lang.String category)
Check if a message of the given level would actually be logged for the category name space. ! |
boolean |
shouldLogDebug()
Deprecated. replaced by level |
boolean |
shouldLogExceptions()
Deprecated. replaced by level |
boolean |
shouldLogExceptionStackTrace()
By default the stack is logged for FINER or less (finest). |
boolean |
shouldPrintConnection()
By default the connection is printed, this can be turned off. |
boolean |
shouldPrintDate()
By default the date is always printed, but can be turned off. |
boolean |
shouldPrintSession()
By default the session (and its connection is available) are printed, this can be turned off. |
boolean |
shouldPrintThread()
By default the thread is logged for FINE or less (finer,etc.). |
void |
throwing(java.lang.Throwable throwable)
Log a throwable at FINER level. |
void |
warning(java.lang.String message)
This method is called when a warning level message needs to be logged. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractSessionLog()
Method Detail |
---|
public static int getDefaultLoggingLevel()
public int getLevel()
Return the log level. It is used when session is not available.
getLevel
in interface SessionLog
public java.lang.String getLevelString()
Return the log level as a string value.
getLevelString
in interface SessionLog
public int getLevel(java.lang.String category)
Return the log level for the category name space.
getLevel
in interface SessionLog
category
- the string representation of a TopLink category, e.g. "sql", "transaction" ...
public void setLevel(int level)
Set the log level. It is used when session is not available.
setLevel
in interface SessionLog
level
- the new log level
public void setLevel(int level, java.lang.String category)
Set the log level for the category name space.
setLevel
in interface SessionLog
level
- the new log levelcategory
- the string representation of a TopLink category, e.g. "sql", "transaction" ...
public boolean shouldLog(int level)
Check if a message of the given level would actually be logged. It is used when session is not available.
shouldLog
in interface SessionLog
level
- the log request level
public boolean shouldLog(int level, java.lang.String category)
Check if a message of the given level would actually be logged for the category name space. !isOff() is checked to screen out the possibility when both log level and log request level are set to OFF.
shouldLog
in interface SessionLog
level
- the log request levelcategory
- the string representation of a TopLink category, e.g. "sql", "transaction" ...*
public static SessionLog getLog()
Return the singleton SessionLog. If the singleton SessionLog does not exist, a new one is created based on the version of JDK being used from the Version class.
public static void setLog(SessionLog sessionLog)
Set the singleton SessionLog.
sessionLog
- a SessionLog
public Session getSession()
Get the session.
getSession
in interface SessionLog
public void setSession(Session session)
Set the session.
setSession
in interface SessionLog
session
- a Session
public void log(int level, java.lang.String message)
Log a message that does not need to be translated. This method is intended for external use when logging messages are required within the TopLink output.
log
in interface SessionLog
level
- the log request level value
message
- the string message - this shout not be a bundle key
public void log(int level, java.lang.String message, java.lang.Object param)
Log a message with one parameter that needs to be translated.
log
in interface SessionLog
level
- the log request level value
message
- the string message
param
- a parameter of the message
public void log(int level, java.lang.String message, java.lang.Object param1, java.lang.Object param2)
Log a message with two parameters that needs to be translated.
log
in interface SessionLog
level
- the log request level value
message
- the string message
param1
- a parameter of the message
param2
- second parameter of the message
public void log(int level, java.lang.String message, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3)
Log a message with three parameters that needs to be translated.
log
in interface SessionLog
level
- the log request level value
message
- the string message
param1
- a parameter of the message
param2
- second parameter of the message
param3
- third parameter of the message
public void log(int level, java.lang.String message, java.lang.Object[] params)
Log a message with an array of parameters that needs to be translated.
log
in interface SessionLog
level
- the log request level value
message
- the string message
params
- array of parameters to the message
public void log(int level, java.lang.String message, java.lang.Object[] params, boolean shouldTranslate)
Log a message. shouldTranslate determines if the message needs to be translated.
log
in interface SessionLog
level
- the log request level
message
- the string message
params
- array of parameters to the message
shouldTranslate
- true if the message needs to be translated
public abstract void log(SessionLogEntry sessionLogEntry)
Log a SessionLogEntry
log
in interface SessionLog
entry
- SessionLogEntry that holds all the information for a TopLink logging event
public void log(SessionLogEntry entry)
log
in interface SessionLog
public boolean shouldPrintSession()
shouldPrintSession
in interface SessionLog
public void setShouldPrintSession(boolean shouldPrintSession)
setShouldPrintSession
in interface SessionLog
public boolean shouldPrintConnection()
shouldPrintConnection
in interface SessionLog
public void setShouldPrintConnection(boolean shouldPrintConnection)
setShouldPrintConnection
in interface SessionLog
public boolean shouldLogExceptions()
shouldLogExceptions
in interface SessionLog
public void setShouldLogExceptions(boolean shouldLogExceptions)
setShouldLogExceptions
in interface SessionLog
public boolean shouldLogExceptionStackTrace()
shouldLogExceptionStackTrace
in interface SessionLog
public void setShouldLogExceptionStackTrace(boolean shouldLogExceptionStackTrace)
setShouldLogExceptionStackTrace
in interface SessionLog
public boolean shouldPrintDate()
shouldPrintDate
in interface SessionLog
public void setShouldPrintDate(boolean shouldPrintDate)
setShouldPrintDate
in interface SessionLog
public boolean shouldPrintThread()
shouldPrintThread
in interface SessionLog
public void setShouldPrintThread(boolean shouldPrintThread)
setShouldPrintThread
in interface SessionLog
public java.io.Writer getWriter()
Return the writer that will receive the formatted log entries.
getWriter
in interface SessionLog
public void setWriter(java.io.Writer writer)
Set the writer that will receive the formatted log entries.
setWriter
in interface SessionLog
writer
- the log writer
public void setWriter(java.io.OutputStream outputstream)
Set the writer that will receive the formatted log entries.
OutputStream
- the log writer
public boolean shouldLogDebug()
shouldLogDebug
in interface SessionLog
public void setShouldLogDebug(boolean shouldLogDebug)
setShouldLogDebug
in interface SessionLog
public java.text.DateFormat getDateFormat()
public void setDateFormat(java.text.DateFormat dateFormat)
dateFormat
- java.text.DateFormatpublic void throwing(java.lang.Throwable throwable)
Log a throwable at FINER level.
throwing
in interface SessionLog
throwable
- a Throwable
public void severe(java.lang.String message)
This method is called when a severe level message needs to be logged. The message will be translated
severe
in interface SessionLog
message
- the message key
public void warning(java.lang.String message)
This method is called when a warning level message needs to be logged. The message will be translated
warning
in interface SessionLog
message
- the message key
public void info(java.lang.String message)
This method is called when a info level message needs to be logged. The message will be translated
info
in interface SessionLog
message
- the message key
public void config(java.lang.String message)
This method is called when a config level message needs to be logged. The message will be translated
config
in interface SessionLog
message
- the message key
public void fine(java.lang.String message)
This method is called when a fine level message needs to be logged. The message will be translated
fine
in interface SessionLog
message
- the message key
public void finer(java.lang.String message)
This method is called when a finer level message needs to be logged. The message will be translated
finer
in interface SessionLog
message
- the message key
public void finest(java.lang.String message)
This method is called when a finest level message needs to be logged. The message will be translated
finest
in interface SessionLog
message
- the message key
public void logThrowable(int level, java.lang.Throwable throwable)
Log a throwable with level.
logThrowable
in interface SessionLog
level
- the log request level value
throwable
- a Throwable
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |