public class AsyncFileHandler extends FileHandler
FileHandler
implementation that uses a queue of log entries.
Configuration properties are inherited from the FileHandler
class. This class does not add its own configuration properties for the
logging configuration, but relies on the following system properties
instead:
org.apache.juli.AsyncOverflowDropType
Default value: 1
org.apache.juli.AsyncMaxRecordCount
Default value: 10000
org.apache.juli.AsyncLoggerPollInterval
Default value: 1000
See the System Properties page in the configuration reference of Tomcat.
Modifier and Type | Class and Description |
---|---|
protected static class |
AsyncFileHandler.LogEntry |
protected static class |
AsyncFileHandler.LoggerThread |
Modifier and Type | Field and Description |
---|---|
protected boolean |
closed |
static int |
DEFAULT_MAX_RECORDS |
protected static AsyncFileHandler.LoggerThread |
logger |
static int |
LOGGER_SLEEP_TIME |
static int |
OVERFLOW_DROP_CURRENT |
static int |
OVERFLOW_DROP_FIRST |
static int |
OVERFLOW_DROP_FLUSH |
static int |
OVERFLOW_DROP_LAST |
static int |
OVERFLOW_DROP_TYPE |
protected static LinkedBlockingDeque<AsyncFileHandler.LogEntry> |
queue |
writerLock
Constructor and Description |
---|
AsyncFileHandler() |
AsyncFileHandler(String directory,
String prefix,
String suffix) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the currently open log file (if any).
|
protected void |
open()
Open the new log file for the date specified by
date . |
void |
publish(LogRecord record)
Format and publish a LogRecord.
|
protected void |
publishInternal(LogRecord record) |
closeWriter, flush, openWriter
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
public static final int OVERFLOW_DROP_LAST
public static final int OVERFLOW_DROP_FIRST
public static final int OVERFLOW_DROP_FLUSH
public static final int OVERFLOW_DROP_CURRENT
public static final int OVERFLOW_DROP_TYPE
public static final int DEFAULT_MAX_RECORDS
public static final int LOGGER_SLEEP_TIME
protected static final LinkedBlockingDeque<AsyncFileHandler.LogEntry> queue
protected static final AsyncFileHandler.LoggerThread logger
protected volatile boolean closed
public void close()
FileHandler
close
in class FileHandler
protected void open()
FileHandler
date
.open
in class FileHandler
public void publish(LogRecord record)
FileHandler
publish
in class FileHandler
record
- description of the log eventprotected void publishInternal(LogRecord record)
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.