springboot关闭启动时候banner及启动日志打印

2021-02-03 10:33:25.224  INFO 17321 --- [           main] o.s.b.d.s.s.SpringApplicationExample    : Starting SpringApplicationExample using Java 1.8.0_232 on mycomputer with PID 17321 (/apps/myjar.jar started by pwebb)
2021-02-03 10:33:25.226  INFO 17900 --- [           main] o.s.b.d.s.s.SpringApplicationExample    : No active profile set, falling back to default profiles: default
2021-02-03 10:33:26.384  INFO 17900 --- [           main] o.s.b.d.s.s.SpringApplicationExample    : Started SampleTomcatApplication in 1.514 seconds (JVM running for 1.823)
根据实际项目日志打印要求,需要关闭以下不符合打印格式的日志输出,这些都是spring框架来打印的:

需要关闭如下配置项(yml格式如下):

spring:
  resources:
    static-locations: classpath:/META-INF/resources/,classpath:/resources/
  main:
      allow-circular-references: true
    # 关闭启动日志打印
      log-startup-info: false
    # 关闭 Spring 默认的 banner 显示
      banner-mode: off

你可能感兴趣的:(Spring,spring,boot,spring,java)