Class QuarkusDelayedHandler
- java.lang.Object
-
- java.util.logging.Handler
-
- org.jboss.logmanager.ExtHandler
-
- io.quarkus.bootstrap.logging.QuarkusDelayedHandler
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,org.jboss.logmanager.handlers.FlushableCloseable
public class QuarkusDelayedHandler extends org.jboss.logmanager.ExtHandler
-
-
Field Summary
Fields Modifier and Type Field Description static StringQUARKUS_LOG_MAX_STARTUP_RECORDSThis 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.
-
Constructor Summary
Constructors Constructor Description QuarkusDelayedHandler()QuarkusDelayedHandler(int queueLimit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHandler(Handler handler)voidaddLoggingCloseTask(Runnable runnable)voidbuildTimeComplete()Handler[]clearHandlers()voidclose()protected voiddoPublish(org.jboss.logmanager.ExtLogRecord record)booleanisActivated()Indicates whether or not this handler has been activated.booleanisCallerCalculationRequired()voidremoveHandler(Handler handler)Handler[]setBuildTimeHandlers(Handler[] newHandlers)voidsetCallerCalculationRequired(boolean callerCalculationRequired)Sets whether or not caller information will be required when formatting records.Handler[]setHandlers(Handler[] newHandlers)-
Methods inherited from class org.jboss.logmanager.ExtHandler
flush, getHandlers, isAutoFlush, isCloseChildren, isEnabled, publish, publish, publishToNestedHandlers, reportError, reportError, setAutoFlush, setCloseChildren, setEnabled, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
-
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable
-
-
-
-
Field Detail
-
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:
- Constant Field Values
-
-
Method Detail
-
doPublish
protected void doPublish(org.jboss.logmanager.ExtLogRecord record)
- Overrides:
doPublishin classorg.jboss.logmanager.ExtHandler
-
close
public final void close() throws SecurityException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classorg.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:
addHandlerin classorg.jboss.logmanager.ExtHandler- Throws:
SecurityException- See Also:
setHandlers(Handler[])
-
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:
setHandlersin classorg.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:
removeHandlerin classorg.jboss.logmanager.ExtHandler- Throws:
SecurityException- See Also:
clearHandlers()
-
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:
clearHandlersin classorg.jboss.logmanager.ExtHandler- Throws:
SecurityException- See Also:
removeHandler(Handler)
-
isCallerCalculationRequired
public boolean isCallerCalculationRequired()
This can be overridden to always require the caller calculation by setting the
setCallerCalculationRequired(boolean)value totrue.- Overrides:
isCallerCalculationRequiredin classorg.jboss.logmanager.ExtHandler- See Also:
setCallerCalculationRequired(boolean)
-
setCallerCalculationRequired
public void setCallerCalculationRequired(boolean callerCalculationRequired)
Sets whether or not caller information will be required when formatting records.If set to
truethe caller information will be calculated for each record that is placed in the queue. A value offalsemeans 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-trueif 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:
trueif the handler has been activated, otherwisefalse
-
-