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 java.util.concurrent.LinkedBlockingDeque<AsyncFileHandler.LogEntry> |
queue |
DEFAULT_MAX_DAYS, writerLock
Constructor and Description |
---|
AsyncFileHandler() |
AsyncFileHandler(java.lang.String directory,
java.lang.String prefix,
java.lang.String suffix) |
AsyncFileHandler(java.lang.String directory,
java.lang.String prefix,
java.lang.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(java.util.logging.LogRecord record)
Format and publish a LogRecord.
|
protected void |
publishInternal(java.util.logging.LogRecord record) |
closeWriter, flush, openWriter
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 java.util.concurrent.LinkedBlockingDeque<AsyncFileHandler.LogEntry> queue
protected static final AsyncFileHandler.LoggerThread logger
protected volatile boolean closed
public AsyncFileHandler()
public AsyncFileHandler(java.lang.String directory, java.lang.String prefix, java.lang.String suffix)
public AsyncFileHandler(java.lang.String directory, java.lang.String prefix, java.lang.String suffix, int maxDays)
public void close()
FileHandler
close
in class FileHandler
protected void open()
FileHandler
date
.open
in class FileHandler
public void publish(java.util.logging.LogRecord record)
FileHandler
publish
in class FileHandler
record
- description of the log eventprotected void publishInternal(java.util.logging.LogRecord record)
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.