Class AsyncFileLogHandler
FileLogHandler that queues records and writes them on a background thread.
Each handler has its own queue. Size and overflow policy come from AsyncFileLogHandlerConfig.
Tomcat reference: https://github.com/apache/tomcat/blob/05b5d70555068a6647226e9924b2d7f1b9978b03/java/org/apache/juli/AsyncFileHandler.java
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanIndicates whether this handler has been closed. -
Constructor Summary
ConstructorsConstructorDescriptionAsyncFileLogHandler(Path logFile) AsyncFileLogHandler(Path logFile, AsyncFileLogHandlerConfig config) -
Method Summary
Methods inherited from class io.github.connellite.logger.FileLogHandler
flushMethods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
-
Field Details
-
closed
protected volatile boolean closedIndicates whether this handler has been closed.
-
-
Constructor Details
-
AsyncFileLogHandler
-
AsyncFileLogHandler
-
-
Method Details
-
close
public void close()Closes this handler. While the JVM is already shutting down, queued records are written first.Tomcat reference: https://github.com/apache/tomcat/blob/05b5d70555068a6647226e9924b2d7f1b9978b03/java/org/apache/juli/AsyncFileHandler.java
- Overrides:
closein classFileLogHandler
-
open
public void open()Reopens a closed handler and starts its writer thread again.Tomcat reference: https://github.com/apache/tomcat/blob/05b5d70555068a6647226e9924b2d7f1b9978b03/java/org/apache/juli/AsyncFileHandler.java
-
publish
Queues the record. Caller data is resolved on this thread before the handoff.Tomcat reference: https://github.com/apache/tomcat/blob/05b5d70555068a6647226e9924b2d7f1b9978b03/java/org/apache/juli/AsyncFileHandler.java
- Overrides:
publishin classFileLogHandler
-
publishInternal
Publishes a log record to the underlying handler.Tomcat reference: https://github.com/apache/tomcat/blob/05b5d70555068a6647226e9924b2d7f1b9978b03/java/org/apache/juli/AsyncFileHandler.java
-