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: 10000See 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 |
static int |
DEFAULT_OVERFLOW_DROP_TYPE |
protected static AsyncFileHandler.LoggerThread |
logger |
static int |
MAX_RECORDS |
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 |
DEFAULT_MAX_DAYS, writerLock| Constructor and Description |
|---|
AsyncFileHandler() |
AsyncFileHandler(String directory,
String prefix,
String suffix) |
AsyncFileHandler(String directory,
String prefix,
String suffix,
int maxDays) |
| 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 DEFAULT_OVERFLOW_DROP_TYPE
public static final int DEFAULT_MAX_RECORDS
public static final int OVERFLOW_DROP_TYPE
public static final int MAX_RECORDS
protected static final LinkedBlockingDeque<AsyncFileHandler.LogEntry> queue
protected static final 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)
FileHandlerLogRecord.publish in class FileHandlerrecord - description of the log eventprotected void publishInternal(LogRecord record)
Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.