When developing with Spring Boot, the console outputs Spring symbols composed of characters when the program starts. This is the Banner that Spring Boot designed for itself
All Spring Boot programs start with Spring output. Isn’t that boring? Wouldn’t it be more fun to output some personal symbols, or the name of the company?
Customize banner Steps
-
Create a new one under SRC /main/resources
banner.txt
, such as:
-
Use the online website to generate the character you want, and copy the character generated by the website to banner.txt. Two online generated sites are recommended:
- www.bootschool.net/ascii-art
- Patorjk.com/software/ta…
-
For example: search for Buddha character, copy the character to
banner.txt
In can
-
When Spring Boot is started, the banner output from the console changes to the effect you just added.
Remove the banner
- If you want to remove the Spring banner icon generated by default. There are two ways to get rid of it
- Add the following code to the Spring Boot Boot class:
SpringApplication application = new SpringApplication(Application.class);
application.setBannerMode(Mode.OFF); // Start boot mode off
application.run(args);
Copy the code
Such as:
- In the configuration file
application.properties
Add:
spring.main.banner-mode=off
Copy the code