Class QuarkusDelayedHandler

java.lang.Object
java.util.logging.Handler
org.jboss.logmanager.ExtHandler
io.quarkus.bootstrap.logging.QuarkusDelayedHandler
All Implemented Interfaces:
Flushable, AutoCloseable

public class QuarkusDelayedHandler extends org.jboss.logmanager.ExtHandler
A handler that queues messages until it's at least one child handler is added or set. If the children handlers are cleared then the handler is no longer considered activated and messages will once again be queued.
  • Field Details

    • QUARKUS_LOG_MAX_STARTUP_RECORDS

      public static final String QUARKUS_LOG_MAX_STARTUP_RECORDS
      This is a system property that can be used to help debug startup issues if TRACE and DEBUG logs are being dropped due to the queue limit being exceeded. This is not a normal config property, and is unlikely to be needed under normal usage.
      See Also:
  • Constructor Details

    • QuarkusDelayedHandler

      public QuarkusDelayedHandler()
    • QuarkusDelayedHandler

      public QuarkusDelayedHandler(int queueLimit)
  • Method Details

    • doPublish

      protected void doPublish(org.jboss.logmanager.ExtLogRecord record)
      Overrides:
      doPublish in class org.jboss.logmanager.ExtHandler
    • close

      public final void close() throws SecurityException
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class org.jboss.logmanager.ExtHandler
      Throws:
      SecurityException
    • addHandler

      public void addHandler(Handler handler) throws SecurityException

      Note that once this is invoked the handler will be activated and the messages will no longer be queued. If more than one child handler is required the setHandlers(Handler[]) should be used.

      Overrides:
      addHandler in class org.jboss.logmanager.ExtHandler
      Throws:
      SecurityException
      See Also:
    • setHandlers

      public Handler[] setHandlers(Handler[] newHandlers) throws SecurityException

      Note that once this is invoked the handler will be activated and the messages will no longer be queued.

      Overrides:
      setHandlers in class org.jboss.logmanager.ExtHandler
      Throws:
      SecurityException
    • addLoggingCloseTask

      public void addLoggingCloseTask(Runnable runnable)
    • setBuildTimeHandlers

      public Handler[] setBuildTimeHandlers(Handler[] newHandlers) throws SecurityException
      Throws:
      SecurityException
    • buildTimeComplete

      public void buildTimeComplete()
    • removeHandler

      public void removeHandler(Handler handler) throws SecurityException

      Note that if the last child handler is removed the handler will no longer be activated and the messages will again be queued.

      Overrides:
      removeHandler in class org.jboss.logmanager.ExtHandler
      Throws:
      SecurityException
      See Also:
    • clearHandlers

      public Handler[] clearHandlers() throws SecurityException

      Note that once this is invoked the handler will no longer be activated and messages will again be queued.

      Overrides:
      clearHandlers in class org.jboss.logmanager.ExtHandler
      Throws:
      SecurityException
      See Also:
    • isCallerCalculationRequired

      public boolean isCallerCalculationRequired()

      This can be overridden to always require the caller calculation by setting the setCallerCalculationRequired(boolean) value to true.

      Overrides:
      isCallerCalculationRequired in class org.jboss.logmanager.ExtHandler
      See Also:
    • setCallerCalculationRequired

      public void setCallerCalculationRequired(boolean callerCalculationRequired)
      Sets whether or not caller information will be required when formatting records.

      If set to true the caller information will be calculated for each record that is placed in the queue. A value of false means the {@link super#isCallerCalculationRequired()} will be used.

      Note that the caller information is only attempted to be calculated when the handler has not been activated. Once activated it's up to the children handlers to determine how the record is processed.

      Parameters:
      callerCalculationRequired - true if the caller information should always be calculated before the record is being placed in the queue
    • isActivated

      public final boolean isActivated()
      Indicates whether or not this handler has been activated.
      Returns:
      true if the handler has been activated, otherwise false