|
Oracle Application Server Java Object Cache API Reference 10g Release 2 (10.1.2) B14018-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.ias.cache.CacheLogger
CacheLogger is an abstract class. Application can extend this class to implement a customized logging mechanism. The caching service uses this API to log cache related messages. User can use Cache.setLogSeverity(int) to change the desirable cache logging severity. The severities are defined in this class.
A default cache logger is implemented, if no cache logger is provided, the default cache logger will be used. By default, DefaultCacheLogger will log all the messages to a file called "javacache.log" in the directory where the server process started. Users can set a different log file name for the default logger when initializes the cache by calling CacheAttributes.setLogFileName(String).
setLogFileName
, DefaultCacheLogger
Field Summary | |
static int |
DEBUG |
static int |
DEFAULT |
static int |
ERROR |
static int |
FATAL |
static int |
INFO |
protected java.lang.String |
logFileName |
static int |
OFF |
protected int |
severity sets the logging severity. |
static int |
TRACE |
static int |
WARNING |
Constructor Summary | |
CacheLogger() |
Method Summary | |
abstract void |
flush() flush will write out the log messages, and clean the logging buffer. |
java.lang.String |
getLogFileName() returns the log file name defined as logFileName in this class. |
int |
getSeverity() returns the severity level defined as severity in this class. |
abstract void |
init(java.lang.String fileName, int severity) is called by the cache when the logging system is initialized. |
abstract void |
log(java.lang.String message) is an abstract method. |
abstract void |
log(java.lang.String message, java.lang.Throwable cause) is an abstract method. |
static int |
parseLogSeverity(java.lang.String name) Parse the severity level |
void |
setSeverity(int sev) changes the severity level defined as severity in this class. |
static java.lang.String |
severityToString(int sev) Translate severity into String format |
boolean |
shouldLog(int sever) returns true if the severity level is such that the message should be logged. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int OFF
public static final int FATAL
public static final int ERROR
public static final int DEFAULT
public static final int WARNING
public static final int TRACE
public static final int INFO
public static final int DEBUG
protected int severity
protected java.lang.String logFileName
Constructor Detail |
public CacheLogger()
Method Detail |
public abstract void log(java.lang.String message)
message
- the message need to be loggedpublic abstract void log(java.lang.String message, java.lang.Throwable cause)
message
- The string message need to be loggedcause
- An object implements the Throwable interface, usually, it is an exception.public abstract void flush()
public abstract void init(java.lang.String fileName, int severity) throws CacheException
fileName
- The name of the file to log toseverity
- The initial logging severityCacheException
public int getSeverity()
public java.lang.String getLogFileName()
public boolean shouldLog(int sever)
public void setSeverity(int sev)
sev
- the logging severitypublic static int parseLogSeverity(java.lang.String name)
name
- to be parsedpublic static java.lang.String severityToString(int sev)
sev
- is the log severity level
|
Oracle Application Server Java Object Cache API Reference 10g Release 2 (10.1.2) B14018-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |