Top Description Inners Fields Constructors Methods
org.apache.juli

public Class AsyncFileHandler

extends FileHandler
Class Inheritance
Imports
java.util.concurrent.LinkedBlockingDeque, .RejectedExecutionException, .RejectedExecutionHandler, .ThreadPoolExecutor, .TimeUnit, java.util.concurrent.atomic.AtomicInteger, java.util.logging.LogRecord

A 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:

See the System Properties page in the configuration reference of Tomcat.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
protected volatile boolean
private final Object
public static final int
public static final int
private static final AsyncFileHandler.LoggerExecutorService
private final AsyncFileHandler.LoggerExecutorService
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
pack-priv static final String
Inherited from org.apache.juli.FileHandler:
DEFAULT_BUFFER_SIZEDEFAULT_MAX_DAYSwriterLock

Constructor Summary

AccessConstructor and Description
public
public
AsyncFileHandler(String directory, String prefix, String suffix)

public
AsyncFileHandler(String directory, String prefix, String suffix, Integer maxDays)

pack-priv
AsyncFileHandler(String directory, String prefix, String suffix, Integer maxDays, AsyncFileHandler.LoggerExecutorService loggerService)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides org.apache.juli.FileHandler.close.

Close the currently open log file (if any).

public void
open()

Overrides org.apache.juli.FileHandler.open.

Open the new log file for the date specified by date.

public void
publish(LogRecord
description of the log event
record
)

Overrides org.apache.juli.FileHandler.publish.

Format and publish a LogRecord.

protected void
Inherited from org.apache.juli.FileHandler:
closeWriterflushopenWriter

Field Detail

closedback to summary
protected volatile boolean closed
closeLockback to summary
private final Object closeLock
DEFAULT_MAX_RECORDSback to summary
public static final int DEFAULT_MAX_RECORDS
DEFAULT_OVERFLOW_DROP_TYPEback to summary
public static final int DEFAULT_OVERFLOW_DROP_TYPE
LOGGER_SERVICEback to summary
private static final AsyncFileHandler.LoggerExecutorService LOGGER_SERVICE
loggerServiceback to summary
private final AsyncFileHandler.LoggerExecutorService loggerService
MAX_RECORDSback to summary
public static final int MAX_RECORDS
OVERFLOW_DROP_CURRENTback to summary
public static final int OVERFLOW_DROP_CURRENT
OVERFLOW_DROP_FIRSTback to summary
public static final int OVERFLOW_DROP_FIRST
OVERFLOW_DROP_FLUSHback to summary
public static final int OVERFLOW_DROP_FLUSH
OVERFLOW_DROP_LASTback to summary
public static final int OVERFLOW_DROP_LAST
OVERFLOW_DROP_TYPEback to summary
public static final int OVERFLOW_DROP_TYPE
THREAD_PREFIXback to summary
pack-priv static final String THREAD_PREFIX

Constructor Detail

AsyncFileHandlerback to summary
public AsyncFileHandler()
AsyncFileHandlerback to summary
public AsyncFileHandler(String directory, String prefix, String suffix)
AsyncFileHandlerback to summary
public AsyncFileHandler(String directory, String prefix, String suffix, Integer maxDays)
AsyncFileHandlerback to summary
pack-priv AsyncFileHandler(String directory, String prefix, String suffix, Integer maxDays, AsyncFileHandler.LoggerExecutorService loggerService)

Method Detail

closeback to summary
public void close()

Overrides org.apache.juli.FileHandler.close.

Doc from org.apache.juli.FileHandler.close.

Close the currently open log file (if any).

Annotations
@Override
openback to summary
public void open()

Overrides org.apache.juli.FileHandler.open.

Doc from org.apache.juli.FileHandler.open.

Open the new log file for the date specified by date.

Annotations
@Override
publishback to summary
public void publish(LogRecord record)

Overrides org.apache.juli.FileHandler.publish.

Doc from org.apache.juli.FileHandler.publish.

Format and publish a LogRecord.

Parameters
record:LogRecord

description of the log event

Annotations
@Override
publishInternalback to summary
protected void publishInternal(LogRecord record)
org.apache.juli back to summary

private Class AsyncFileHandler.DropFlushPolicy

extends Object
implements RejectedExecutionHandler
Class Inheritance
All Implemented Interfaces
java.util.concurrent.RejectedExecutionHandler

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
rejectedExecution(Runnable
the runnable task requested to be executed
r
,
ThreadPoolExecutor
the executor attempting to execute this task
executor
)

Implements java.util.concurrent.RejectedExecutionHandler.rejectedExecution.

Method that may be invoked by a ThreadPoolExecutor when execute cannot accept a task.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DropFlushPolicyback to summary
private DropFlushPolicy()

Method Detail

rejectedExecutionback to summary
public void rejectedExecution(Runnable r, ThreadPoolExecutor executor)

Implements java.util.concurrent.RejectedExecutionHandler.rejectedExecution.

Doc from java.util.concurrent.RejectedExecutionHandler.rejectedExecution.

Method that may be invoked by a ThreadPoolExecutor when execute cannot accept a task. This may occur when no more threads or queue slots are available because their bounds would be exceeded, or upon shutdown of the Executor.

In the absence of other alternatives, the method may throw an unchecked RejectedExecutionException, which will be propagated to the caller of execute.

Parameters
r:Runnable

the runnable task requested to be executed

executor:ThreadPoolExecutor

the executor attempting to execute this task

Annotations
@Override
org.apache.juli back to summary

private Class AsyncFileHandler.DropLastPolicy

extends Object
implements RejectedExecutionHandler
Class Inheritance
All Implemented Interfaces
java.util.concurrent.RejectedExecutionHandler

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
rejectedExecution(Runnable
the runnable task requested to be executed
r
,
ThreadPoolExecutor
the executor attempting to execute this task
executor
)

Implements java.util.concurrent.RejectedExecutionHandler.rejectedExecution.

Method that may be invoked by a ThreadPoolExecutor when execute cannot accept a task.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DropLastPolicyback to summary
private DropLastPolicy()

Method Detail

rejectedExecutionback to summary
public void rejectedExecution(Runnable r, ThreadPoolExecutor executor)

Implements java.util.concurrent.RejectedExecutionHandler.rejectedExecution.

Doc from java.util.concurrent.RejectedExecutionHandler.rejectedExecution.

Method that may be invoked by a ThreadPoolExecutor when execute cannot accept a task. This may occur when no more threads or queue slots are available because their bounds would be exceeded, or upon shutdown of the Executor.

In the absence of other alternatives, the method may throw an unchecked RejectedExecutionException, which will be propagated to the caller of execute.

Parameters
r:Runnable

the runnable task requested to be executed

executor:ThreadPoolExecutor

the executor attempting to execute this task

Annotations
@Override
org.apache.juli back to summary

pack-priv Class AsyncFileHandler.LoggerExecutorService

extends ThreadPoolExecutor
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final AtomicInteger
private static final FileHandler.ThreadFactory

Constructor Summary

AccessConstructor and Description
pack-priv
LoggerExecutorService(final int overflowDropType, final int maxRecords)

Method Summary

Modifier and TypeMethod and Description
public void
public LinkedBlockingDeque<Runnable>
getQueue()

Overrides java.util.concurrent.ThreadPoolExecutor.getQueue.

Returns the task queue used by this executor.

public void
Inherited from java.util.concurrent.ThreadPoolExecutor:
afterExecuteallowCoreThreadTimeOutallowsCoreThreadTimeOutawaitTerminationbeforeExecuteexecutefinalizegetActiveCountgetCompletedTaskCountgetCorePoolSizegetKeepAliveTimegetLargestPoolSizegetMaximumPoolSizegetPoolSizegetRejectedExecutionHandlergetTaskCountgetThreadFactoryisShutdownisTerminatedisTerminatingprestartAllCoreThreadsprestartCoreThreadpurgeremovesetCorePoolSizesetKeepAliveTimesetMaximumPoolSizesetRejectedExecutionHandlersetThreadFactoryshutdownshutdownNowterminatedtoString

Field Detail

handlerCountback to summary
private final AtomicInteger handlerCount
THREAD_FACTORYback to summary
private static final FileHandler.ThreadFactory THREAD_FACTORY

Constructor Detail

LoggerExecutorServiceback to summary
pack-priv LoggerExecutorService(final int overflowDropType, final int maxRecords)

Method Detail

deregisterHandlerback to summary
public void deregisterHandler()
getQueueback to summary
public LinkedBlockingDeque<Runnable> getQueue()

Overrides java.util.concurrent.ThreadPoolExecutor.getQueue.

Doc from java.util.concurrent.ThreadPoolExecutor.getQueue.

Returns the task queue used by this executor. Access to the task queue is intended primarily for debugging and monitoring. This queue may be in active use. Retrieving the task queue does not prevent queued tasks from executing.

Returns:LinkedBlockingDeque<Runnable>

the task queue

Annotations
@Override
registerHandlerback to summary
public void registerHandler()