【发布时间】:2021-07-27 04:32:41
【问题描述】:
我有一个简单的 Spring Boot 应用程序,它具有 logbook-spring-boot-starter 依赖于 logbook 库。
文件说忽略健康检查请求,请像这样连接日志:
Logbook logbook = Logbook.builder()
.condition(exclude(
requestTo("/health"),
requestTo("/admin/**"),
contentType("application/octet-stream"),
header("X-Secret", newHashSet("1", "true")::contains)))
.build();
这听起来可能很幼稚,但我不知道应该在哪里连接它。我应该把它放在任何带有特定注释的特定类或方法中吗?举个例子会有所帮助。
【问题讨论】:
标签: java spring spring-boot logbook