use of org.jboss.logmanager.ExtHandler in project quarkus-logging-logback by quarkiverse.
the class LogbackRecorder method createHandler.
public RuntimeValue<Optional<Handler>> createHandler() {
started = true;
for (DelayedStart i : DELAYED_START_HANDLERS) {
i.doQuarkusDelayedStart();
}
DELAYED_START_HANDLERS.clear();
return new RuntimeValue<>(Optional.of(new ExtHandler() {
@Override
public final void doPublish(final ExtLogRecord record) {
if (defaultLoggerContext == null) {
return;
}
Logger logger = defaultLoggerContext.getLogger(record.getLoggerName());
logger.callAppenders(new LoggingEventWrapper(record, getFormatter()));
}
@Override
public void flush() {
}
@Override
public void close() throws SecurityException {
}
}));
}
Aggregations