在Spring启动应用程序中使用Google flogger时,我遇到了以下错误。我已经添加了maven依赖项,所以没有编译时错误。
public class FloggerLoggingExample {
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
@Test
public void test_flogger() {
logger.atWarning().log("warning");
logger.atInfo().log("info");
logger.at(Level.SEVERE)
.atMostEvery(50, TimeUnit.SECONDS)
.log("SEVERE");
}
}Caused by: java.lang.IllegalStateException: No logging platforms found:
com.google.common.flogger.backend.system.DefaultPlatform: java.lang.ClassNotFoundException: com.google.common.flogger.backend.system.DefaultPlatform发布于 2019-05-06 19:50:40
如果不看一下pom.xml就很难说,但我相信你的pom.xml中缺少flogger-system-backend。试着把它加进去。
<dependency>
<groupId>com.google.flogger</groupId>
<artifactId>flogger-system-backend</artifactId>
<version>0.4</version>
</dependency>https://stackoverflow.com/questions/55993417
复制相似问题