Package | Class | Tree | Deprecated | Index | Help
| Oracle Application Server Java Object Cache API Reference 10g Release 3 (10.1.3) B25712-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ias.cache
Class DefaultCacheLogger

`java.lang.Object
java.util.logging.Logger
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

Field Summary

Fields inherited from class oracle.ias.cache.CacheLogger
`DEBUG, DEFAULT, ERROR, FATAL, INFO, logFileName, OFF, severity, TRACE, WARNING`

Fields inherited from class java.util.logging.Logger
`global`

Constructor Summary
`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.

Method Summary
`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 oracle.ias.cache.CacheLogger
`getLogFileName, getSeverity, parseLogSeverity, severityToString, shouldLog`

Methods inherited from class java.util.logging.Logger
`addHandler, config, entering, entering, entering, exiting, exiting, fine, finer, finest, getAnonymousLogger, getAnonymousLogger, getFilter, getHandlers, getLevel, getLogger, getLogger, getName, getParent, getResourceBundle, getResourceBundleName, getUseParentHandlers, info, isLoggable, log, log, log, log, log, logp, logp, logp, logp, logrb, logrb, logrb, logrb, removeHandler, setFilter, setLevel, setParent, setUseParentHandlers, severe, throwing, warning`

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

Constructor Detail

### 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 system
  `filename` - absolute path to the desired log file.
Since:
  2.0.0

### DefaultCacheLogger

    public DefaultCacheLogger()
                       throws CacheException

Method Detail

### 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.
  Specified by:
    `init` in class `CacheLogger`
  Parameters:
    `filename` - The name of the file to log to
    `sev` - The initial logging severity
  Throws:
    `CacheException`

### finalize

    public void finalize()

  let the garbage collection thread releases resources.
  Since:
    2.0.0

### log

    public void log(java.lang.String message)

  logs a message to the specified log file.
  Specified by:
    `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.
  Specified by:
    `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.
  Specified by:
    `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`
  Parameters:
    `sev` - the logging severity

Package | Class | Tree | Deprecated | Index | Help
| Oracle Application Server Java Object Cache API Reference 10g Release 3 (10.1.3) B25712-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004, 2005, Oracle. All rights reserved.