已解决sringboot整合tinylog时控制台打印红色的Apache相关日志

今天在整合tinylog时,发现控制台老是打印红色的日志,再仔细观察都是Apache相关的,这是为什么?能不能把这些日志去除或者隐藏掉?

redlog.png

可以确定tinylog已经整合成功,以下是整合时的pom依赖:

<!--引入tinylog日志依赖-->
<dependency>
<groupId>org.tinylog</groupId>
<artifactId>tinylog-api</artifactId>
<version>${tinylog.version}</version>
</dependency>
<dependency>
<groupId>org.tinylog</groupId>
<artifactId>tinylog-impl</artifactId>
<version>${tinylog.version}</version>
</dependency>
<dependency>
<groupId>org.tinylog</groupId>
<artifactId>slf4j-tinylog</artifactId>
<version>${tinylog.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.tinylog</groupId>
<artifactId>jcl-tinylog</artifactId>
<version>${tinylog.version}</version>
</dependency>
<dependency>
<groupId>org.tinylog</groupId>
<artifactId>log4j1.2-api</artifactId>
<version>${tinylog.version}</version>
</dependency>

还有tinylog.properties配置文件:

writer1       = console
writer1.level = info
writer1.format = {date: HH:mm:ss.SSS} {tag} {level}: {message}
exception = keep: com.snow

writer2 = rolling file
writer2.file = snowlog/{date: YYYY-MM-DD}-snowlog.txt
writer2.level = info
writer2.format = {date: HH:mm:ss.SSS} {tag} {level}: {message}

参考教程:

https://blog.didispace.com/spring-boot-learning-2-8-3/

请登录后发表评论