Class AsyncFileLogHandler


public class AsyncFileLogHandler extends FileLogHandler
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 Details

    • closed

      protected volatile boolean closed
      Indicates whether this handler has been closed.
  • Constructor Details

  • 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:
      close in class FileLogHandler
    • 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

      public void publish(LogRecord record)
      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:
      publish in class FileLogHandler
    • publishInternal

      protected void publishInternal(LogRecord record)
      Publishes a log record to the underlying handler.

      Tomcat reference: https://github.com/apache/tomcat/blob/05b5d70555068a6647226e9924b2d7f1b9978b03/java/org/apache/juli/AsyncFileHandler.java