spring-boot - 日志记录执行器健康调用,即使在排除时也是如此

我将 Zolando Logbook 用于 Spring Boot 服务(版本 2.1.6 spring boot 版本,1.13.0 Logbook 版本)并且执行器健康端点被记录,即使它被指定为排除。当包含在 yaml 文件中时,其他端点被正确排除。

这是 yaml 文件的相关部分:

logbook:
  exclude:
    - /actuator/health
    - /actuator/**
    - /health
    - /v2/api-docs
    - /swagger-ui.html

最佳答案

我遇到了同样的问题, 我试过如下并且有效:

logbook:
  exclude[1]: '**/swagger-ui.html'
  exclude[0]: '**/v2/api-docs'
  exclude[3]: '**/swagger-resources/**'
  exclude[2]: '**/webjars/**'
  exclude[5]: '**/'
  exclude[4]: '**/csrf'

如果您有 .properties 文件:

logbook.exclude[0]=**/v2/api-docs
logbook.exclude[1]=**/swagger-ui.html
logbook.exclude[2]=**/webjars/**
logbook.exclude[3]=**/swagger-resources/**
logbook.exclude[4]=**/csrf
logbook.exclude[5]=**/

如果您必须排除更多路径,您可以定义为:

logbook.write.max-body-size=10

我从 here 中获取了解决方案

https://stackoverflow.com/questions/57167490/

相关文章:

c# - Process.Start 无法正确运行批处理文件

swift - 如何使用 AVAudioEngine 在同一时间更改音调和速率

node.js - 如何在模块加载到 NodeJS 之前获取和使用 Secret Manager 值

php - 在电子邮件中添加 PhpSpreadsheet 附件

amazon-web-services - 使用 aws sts assume-role 配置 AW

angular - ionic 4 : Ion-checkbox checked not updat

javascript - 防止在 body 上滚动(Matter.js)

java - CrudRepository delete 是否也删除了 Blob 字段的底层大对象

javascript - 使用 axios 向服务器发出请求会卡住 React Native 应用程

reactjs - 使用重新选择选择器时无法提供/测试传奇