org.apache.tomcat.util.qlog
Class QueueLogger

java.lang.Object
  extended byorg.apache.tomcat.util.log.LogHandler
      extended byorg.apache.tomcat.util.qlog.Logger
          extended byorg.apache.tomcat.util.qlog.QueueLogger

public class QueueLogger
extends Logger

A real implementation of the Logger abstraction. It uses a log queue, so that the caller will not have to wait.

Since:
Tomcat 3.1
Author:
Anil V (akv@eng.sun.com)

Field Summary
 
Fields inherited from class org.apache.tomcat.util.qlog.Logger
custom, day, defaultSink, MAX_THROWABLE_DEPTH, path, timestamp, timestampFormat, timestampFormatter, timestampRaw
 
Fields inherited from class org.apache.tomcat.util.log.LogHandler
level, sink
 
Constructor Summary
QueueLogger()
           
 
Method Summary
 void flush()
          Flush the queue - in a separate thread, so that caller doesn't have to wait
 void log(java.lang.String prefix, java.lang.String message, java.lang.Throwable t, int verbosityLevel)
          Adds a log message and stack trace to the queue and returns immediately.
 void setLogDaemon(LogDaemon ld)
           
 
Methods inherited from class org.apache.tomcat.util.qlog.Logger
formatTimestamp, formatTimestamp, getDatePrefix, getDay, getLevel, getPath, getTimestampFormat, getVerbosityLevel, isTimestamp, open, setDefaultSink, setPath, setTimestamp, setTimestampFormat, setVerbosityLevel, setVerbosityLevel, throwableToString, throwableToString
 
Methods inherited from class org.apache.tomcat.util.log.LogHandler
close, setLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueLogger

public QueueLogger()
Method Detail

setLogDaemon

public void setLogDaemon(LogDaemon ld)

log

public void log(java.lang.String prefix,
                java.lang.String message,
                java.lang.Throwable t,
                int verbosityLevel)
Adds a log message and stack trace to the queue and returns immediately. The logger daemon thread will pick it up later and actually print it out.

Overrides:
log in class LogHandler
Parameters:
message - the message to log.
t - the exception that was thrown.
verbosityLevel - what type of message is this? (WARNING/DEBUG/INFO etc)
prefix - optional prefix.

flush

public void flush()
Flush the queue - in a separate thread, so that caller doesn't have to wait

Overrides:
flush in class LogHandler


Copyright © 2001 Apache Software Foundation. All Rights Reserved.