zl程序教程

您现在的位置是:首页 >  工具

当前栏目

SpringBoot2.x个性化启动banner设置和debug日志

日志 设置 启动 debug 个性化 SpringBoot2 Banner
2023-09-14 08:57:06 时间

3、SpringBoot2.x个性化启动banner设置和debug日志

简介:自定义应用启动的趣味性日志图标和查看调试日志

1、启动获取更多信息 java -jar xxx.jar --debug

2、修改启动的banner信息

1)在类路径下增加一个banner.txt,里面是启动要输出的信息

2)在applicatoin.properties增加banner文件的路径地址 

spring.banner.location=banner.txt

3)官网地址 https://docs.spring.io/spring-boot/docs/2.1.0.BUILD-SNAPSHOT/reference/htmlsingle/#boot-features-banners

示例:

默认Banner:

在 src/main/resources下创建banner.txt

修改内容如下:

在application.properties添加如下内容: