日志格式配置之后未生效
来源:12-14 使用TraceId实现系统请求跟踪

夏目鲸鱼
2021-02-13
配置了logging.pattern.console=%clr(%d{${LOG_DATEFORMAT_PATTERN:yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr([%X{traceId}]) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n
输出
[main] INFO org.quartz.impl.StdSchedulerFactory - Quartz scheduler 'quartzScheduler' initialized from an externally provided properties instance.
[main] INFO org.quartz.impl.StdSchedulerFactory - Quartz scheduler version: 2.3.0
[main] INFO org.quartz.core.QuartzScheduler - JobFactory set to: org.springframework.scheduling.quartz.SpringBeanJobFactory@9b367c8
[main] WARN org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$DefaultTemplateResolverConfiguration - Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration)
[main] INFO org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path ''
[main] INFO org.springframework.scheduling.quartz.SchedulerFactoryBean - Starting Quartz Scheduler now
[main] INFO org.quartz.core.QuartzScheduler - Scheduler quartzScheduler_$_NON_CLUSTERED started.
[main] INFO com.kronos.Application - Started Application in 4.604 seconds (JVM running for 6.084)
写回答
4回答
-
我这边测试是没问题的,确实重新设置了log的输入格式:
配置前:
配置后:
022021-02-17 -
慕前端5083559
2022-07-03
添加@Component就可以了
10 -
夏目鲸鱼
提问者
2021-02-17
是不是有什么基础依赖包
00 -
夏目鲸鱼
提问者
2021-02-17
我配置前后都没有id
00
相似问题