javax.util.jcache
Class CacheLogger

java.lang.Object
  extended by javax.util.jcache.CacheLogger
Direct Known Subclasses:
DefaultCacheLogger

Deprecated. will be removed and replaced with jdk1.4 logging or log4j.

public abstract class CacheLogger
extends Object

Applications can either extend this class to implement a customized logging mechanism. The caching service uses this API to log cache related events. Users can use the Cache.setLogSeverity(int) to change the desirable cache logging severity. The severity levels are defined as: OFF FATAL ERROR DEFAULT WARNING TRACE INFO DEBUG 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 "jcache.log" in the directory where the server process is started. Users can set a differen log file name for the default logger when initializing the cache by calling CacheAttributes.setLogFileName(String).

Author:
Frank Karlstrøm

Field Summary
static int DEBUG
          Deprecated. an int describing that debugmessages and higher should be logged.
static int DEFAULT
          Deprecated. an int describing that default logging severity is applied.
static int ERROR
          Deprecated. an int describing that only errors or higher should be logged.
static int FATAL
          Deprecated. an int describing that only fatal errors should be logged.
static int INFO
          Deprecated. an int describing that informational messages and higher should be logged.
static int OFF
          Deprecated. an int describing that the logging is off.
static int TRACE
          Deprecated. an int describing that tracing messages and higher should be logged.
static int WARNING
          Deprecated. an int describing that only warnings or higher should be logged.
 
Constructor Summary
protected CacheLogger()
          Deprecated. Creates new CacheLogger.
 
Method Summary
abstract  void flush()
          Deprecated. log messages are buffered by the cache.
static int getSeverity()
          Deprecated. returns the current severity level defined in this class.
abstract  void init(String fileName, int severity)
          Deprecated. is called by the caching system when the CacheLogger is instanciated to complete any initialization requirements.
abstract  void log(String message)
          Deprecated. application writers can implement this method and provide their own mechanism to log a message.
abstract  void log(String message, Throwable cause)
          Deprecated. application writers can implement this method and provide their own mechanism to log a message.
 void setSeverity(int severity)
          Deprecated. sets the severity level to the specified level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OFF

public static final int OFF
Deprecated. 
an int describing that the logging is off.

See Also:
Constant Field Values

FATAL

public static final int FATAL
Deprecated. 
an int describing that only fatal errors should be logged.

See Also:
Constant Field Values

ERROR

public static final int ERROR
Deprecated. 
an int describing that only errors or higher should be logged.

See Also:
Constant Field Values

WARNING

public static final int WARNING
Deprecated. 
an int describing that only warnings or higher should be logged.

See Also:
Constant Field Values

INFO

public static final int INFO
Deprecated. 
an int describing that informational messages and higher should be logged.

See Also:
Constant Field Values

DEFAULT

public static final int DEFAULT
Deprecated. 
an int describing that default logging severity is applied. (info is default)

See Also:
Constant Field Values

DEBUG

public static final int DEBUG
Deprecated. 
an int describing that debugmessages and higher should be logged.

See Also:
Constant Field Values

TRACE

public static final int TRACE
Deprecated. 
an int describing that tracing messages and higher should be logged.

See Also:
Constant Field Values
Constructor Detail

CacheLogger

protected CacheLogger()
Deprecated. 
Creates new CacheLogger.

Method Detail

log

public abstract void log(String message)
Deprecated. 
application writers can implement this method and provide their own mechanism to log a message.

Parameters:
message - the message to log.

log

public abstract void log(String message,
                         Throwable cause)
Deprecated. 
application writers can implement this method and provide their own mechanism to log a message.

Parameters:
message - The message to log.
cause - The Exception responsible for causing an log event to happen.

init

public abstract void init(String fileName,
                          int severity)
Deprecated. 
is called by the caching system when the CacheLogger is instanciated to complete any initialization requirements.

Parameters:
fileName - the value from the CacheAttribute
severity - the value from the CacheAttributes.

flush

public abstract void flush()
Deprecated. 
log messages are buffered by the cache. This method will force the messages to be written out the destination and the buffer is reset.


getSeverity

public static int getSeverity()
Deprecated. 
returns the current severity level defined in this class. The severity level determines the amount of information that will be logged. The default setting is DEFAULT.

Returns:
the current severity level defined in this class.

setSeverity

public final void setSeverity(int severity)
Deprecated. 
sets the severity level to the specified level. The severity level determines the amount of information that will be logged. The default setting is DEFAULT.

Parameters:
severity - the severity level to set.


Copyright © 2002-2009 Hosted by SourceForge. All Rights Reserved.