Logback的默认追加文件:
ch.qos.logback.core.FileAppender
同步还是异步?它似乎是同步的,因为日志显示为同一线程的一部分。
最佳答案
是的,默认是同步的。可以看到a config example on how to make it asynchronous in the documentation .
通过这种方式,您可以使任何 Appender
变得异步(通过简单地将其包装在AsyncAppender
中)比所有 Appender
实现必须自行管理异步性。
关于java - Logback 日志记录 - 同步或异步,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30041842/