我有一个简单的 Spring boot 应用程序,logbook-spring-boot-starter
依赖于日志库。
该文件指出,要忽略健康检查请求,请像这样连接日志:
Logbook logbook = Logbook.builder()
.condition(exclude(
requestTo("/health"),
requestTo("/admin/**"),
contentType("application/octet-stream"),
header("X-Secret", newHashSet("1", "true")::contains)))
.build();
Run Code Online (Sandbox Code Playgroud)
这听起来可能很天真,但我不知道应该在哪里连接它。我应该将它放在带有特定注释的任何特定类或方法中吗?举个例子会有帮助。
I'm trying to setup logbook
in a PyTest test to output everything to both stderr
and a file. The file should get every log level, but stderr
should have a higher threshold (which PyTest will manage with it's usual capture settings).
I've got the pytest-logbook
plugin. That redirects stderr
into PyTest capture, but I'm not sure how to add the file output.
This is (hopefully) obvious to someone that knows logbook, but it's new to me.
One more thing, I …