【问题标题】:spring boot + splunk弹簧靴 + splunk
【发布时间】:2021-04-20 15:22:15
【问题描述】:

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

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

这是我处理日志配置的 yml 的 sn-p

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

【问题讨论】:

  • 尝试去掉pom.xml中spring boot的版本行

标签: spring spring-boot logging splunk


【解决方案1】:

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

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

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

【讨论】:

    猜你喜欢
    • 2017-12-22
    • 2018-02-14
    • 2019-05-03
    • 1970-01-01
    • 2023-01-07
    • 2021-12-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多