|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.logging.Handler dk.netarkivet.monitor.logging.CachingLogHandler
public class CachingLogHandler
A LogHandler that keeps the last N messages in memory, and exposes each as a CachingLogRecordMBean.
Constructor Summary | |
---|---|
CachingLogHandler()
Initialise the handler datastructures, and register MBeans for all log records. |
Method Summary | |
---|---|
void |
close()
Close the Handler and free all associated resources. |
void |
flush()
Does nothing. |
java.util.logging.LogRecord |
getNthLogRecord(int n)
Returns the nth logrecord from the top. |
void |
publish(java.util.logging.LogRecord record)
Publish a LogRecord. |
Methods inherited from class java.util.logging.Handler |
---|
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CachingLogHandler()
SingleMBeanObject
,
The number of remembered log records is read from the setting
Settings.LOGGING_HISTORY_SIZE
Method Detail |
---|
public void publish(java.util.logging.LogRecord record)
publish
in class java.util.logging.Handler
record
- description of the log event. A null record is silently
ignored and is not publishedHandler.publish(LogRecord)
public void flush()
flush
in class java.util.logging.Handler
public void close() throws java.lang.SecurityException
The close method will perform a flush and then close the Handler. After close has been called this Handler should no longer be used. Method calls may either be silently ignored or may throw runtime exceptions.
close
in class java.util.logging.Handler
java.lang.SecurityException
- never.public java.util.logging.LogRecord getNthLogRecord(int n)
n
- The number of the log record to get
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |