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: 1org.apache.juli.AsyncMaxRecordCount
Default value: 10000org.apache.juli.AsyncLoggerPollInterval
Default value: 1000See 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, openWritergetEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevelpublic 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 LinkedBlockingDeque<AsyncFileHandler.LogEntry> queue
protected static AsyncFileHandler.LoggerThread logger
protected volatile boolean closed
public void close()
FileHandlerclose in class FileHandlerprotected void open()
FileHandlerdate.open in class FileHandlerpublic void publish(LogRecord record)
FileHandlerpublish in class FileHandlerrecord - description of the log eventprotected void publishInternal(LogRecord record)
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.