1. 程式人生 > >SpringBoot2.x個性化啟動banner設定和debug日誌

SpringBoot2.x個性化啟動banner設定和debug日誌

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新增如下內容: