oracle.ias.cache
Class DefaultCacheLogger
java.lang.Object
|
+--oracle.ias.cache.CacheLogger
|
+--oracle.ias.cache.DefaultCacheLogger
- public class DefaultCacheLogger
- extends CacheLogger
DefaultCacheLogger extends CacheLogger abstract class and provides a
default logging implementation.
If no logger is passed in Cache.init(CacheAttributes), the DefaultCacheLogger
will be used. By default, the DefaultCacheLogger will log the cache logging
messages to a file called "javacache.log" in the directory where the server
process is started. If a user
wishes to log the message to a different file, the user can either
instantiate a DefaultCacheLogger and pass in a logging file name in the
constructor, or set the defaultLogFileName in the CacheAttributes when
the cache is initialized.
By default, DefaultCacheLogger will set logging severity to DEFAULT, which
will only log FATAL and ERROR cache messages. User can change the severity by
either calling static method Cache.setLogSeverity(int), or call the
setSeverity(int) on the logger object.
- Since:
- 2.0.0
DefaultCacheLogger()
|
DefaultCacheLogger(int sev)
Creates a new DefaultCacheLogger with logging severity set to sev. |
DefaultCacheLogger(int sev,
java.lang.String filename)
Creates a new DefaultCacheLogger with the logging severity set to sev,
and the filename will be used as the log file instead of the default log
file. |
Type | Method |
void |
finalize()
let the garbage collection thread releases resources. |
void |
flush()
flush method writes out the messages to the log file, and clear
the logging buffer. |
void |
init(java.lang.String filename,
int sev)
is called by the cache when the logging system is initialized. |
void |
log(java.lang.String message)
logs a message to the specified log file. |
void |
log(java.lang.String message,
java.lang.Throwable cause)
logs a message and the exception stack to the specified log file. |
void |
setSeverity(int sev)
changes the severity level defined as severity
in this class. |
void |
setShowThreadId(boolean show)
|
void |
setShowTimeStamp(boolean show)
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultCacheLogger
public DefaultCacheLogger(int sev)
throws CacheException
- Creates a new DefaultCacheLogger with logging severity set to sev.
- Parameters:
sev
- the logging severity passed to caching system- Since:
- 2.0.0
DefaultCacheLogger
public DefaultCacheLogger(int sev,
java.lang.String filename)
throws CacheException
- Creates a new DefaultCacheLogger with the logging severity set to sev,
and the filename will be used as the log file instead of the default log
file.
- Parameters:
sev
- the logging severity passed to caching systemfilename
- absolute path to the desired log file.- Since:
- 2.0.0
DefaultCacheLogger
public DefaultCacheLogger()
throws CacheException
init
public void init(java.lang.String filename,
int sev)
throws CacheException
- Description copied from class:
CacheLogger
- is called by the cache when the logging system is initialized. This
method will set the initial logging severity and log file name.
- Overrides:
init
in class CacheLogger
- Following copied from class:
oracle.ias.cache.CacheLogger
- Parameters:
fileName
- The name of the file to log toseverity
- The initial logging severity
finalize
public void finalize()
- let the garbage collection thread releases resources.
- Overrides:
finalize
in class java.lang.Object
- Since:
- 2.0.0
log
public void log(java.lang.String message)
- logs a message to the specified log file.
- Overrides:
log
in class CacheLogger
- Parameters:
message
- the message to be logged.- Since:
- 2.0.0
log
public void log(java.lang.String message,
java.lang.Throwable cause)
- logs a message and the exception stack to the specified log file.
- Overrides:
log
in class CacheLogger
- Parameters:
message
- the message to be logged.cause
- usually it is the exception need to be logged.- Since:
- 2.0.0
setShowTimeStamp
public void setShowTimeStamp(boolean show)
setShowThreadId
public void setShowThreadId(boolean show)
flush
public void flush()
- flush method writes out the messages to the log file, and clear
the logging buffer.
- Overrides:
flush
in class CacheLogger
- Since:
- 2.0.0
setSeverity
public void setSeverity(int sev)
- Description copied from class:
CacheLogger
- changes the severity level defined as severity
in this class.
- Overrides:
setSeverity
in class CacheLogger
- Following copied from class:
oracle.ias.cache.CacheLogger
- Parameters:
sev
- the logging severity