弹簧靴 + splunk

时间:2021-01-15 15:22:34

标签: spring spring-boot logging splunk

我有一个 Spring Boot 应用程序,它写入日志文件并使用 splunk 转发器。一切正常,我的日志出现在 splunk 上。当我从 spring boot 版本 2.2.5 升级到 spring boot 2.3.4 时。我的日志没有被推送到 splunk。

我尝试过降级,但日志又开始被推送到 splunk。

这是我处理日志配置的 yml 片段

logging:
  file: myLogs.log
  level:
    org:
      springframework:
        web:
          filter:
            CommonsRequestLoggingFilter: DEBUG

1 个答案:

答案 0 :(得分:0)

问题是在升级 spring boot 之后,您现在需要使用这样的 yml 结构:

logging:
  level:
    org:
      springframework:
        web:
          filter:
            CommonsRequestLoggingFilter: DEBUG
  file:
    name: server.log

不要忘记你的 java arg for -Dlogging 需要从 -Dlogging.file -Dlogging.file.name