2

In SpringBoot, I am using Logback's AsyncAppender to output logs asynchronously. I would like to know how to force a flush from a single logger that tied to AsyncAppender. I know that I can flush all the loggers with the following code.

LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
loggerContext.stop();

For a single logger, is there any way to flush the log queued by AsyncAppender like LoggerFactory.getLogger().flush?

skmq0106
  • 31
  • 1

0 Answers0