springboot 错误笔记

1. spring logback 控制台日志 出现 INFO   类似错误显示字符:

能够出现上面的原因是你的控制台输出工具不支持 ANSI 彩色字符,但是你的 Spring 配置文件中又强制了使用彩色字符。

查找你的 Spring 配置文件:application.properties 中的配置:

spring.output.ansi.enabled=ALWAYS
如果你看到上面的参数是 ALWAYS 的话,你需要调整使用为:DETECT

这个配置选项有 3 个参数:

ALWAYS:总是输出彩色日志
DETECT:根据控制台的情况确定是否输出彩色日志
NEVER:永远不输出彩色日志
修改后的配置参数应该为:

spring.output.ansi.enabled=DETECT

2.application.yml文件中@符号识别不了
org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token
found character '@' that cannot start any token. (Do not use @ for indentation)
in 'reader', line 9, column 12:
version: @project.version@
^

pom的build中加入

src/main/resources true
posted @ 2022-09-28 17:01  qwer78  阅读(139)  评论(0)    收藏  举报