How do you change the Spring Boot startup banner?
I sometimes feel as though the Spring Boot banner is mocking me.
I’m working hard, troubleshooting code, and I just can’t get things to work. That Spring Boot banner appears, telling me: “Hey, Spring Boot is doing just fine. The problem here, is you.”
How do you turn off the Spring Boot banner?
The first line of defense against Spring Boot’s banner? Simply turn it off.
spring.main.show-banner=false
This turns the banner off completely, so you won’t see it anymore. However, disabling the Spring Boot banner entirely can feel like a drastic measure.
My preference? Simply customize it.
To replace the default Spring banner, add a file named banner.txt in the resources folder of your application.
It’s easy to customize the Spring Boot banner to your liking.
How do you customize the Spring Boot banner?
You can add any text you want to the banner.txt file. My suggestion? Add data that will help with the troubleshooting effort. Here are some suggestions:
- The active version of the Spring Boot framework in use.
- The currently active Spring profile.
- The currently configured logging levels.
- The name of the Spring Boot application.
- Custom Spring Boot banner example.
Custom Spring Boot banner example
Here’s a simple, sample Spring Boot banner that provides basic but important configuration information when your application starts up:
${application.title} ${application.version}
${spring.application.name} is starting
The currently active profile is: ${spring.profiles.active}
The web application is running on port: ${server.port}
Powered by Spring Boot Version ${spring-boot.version}
Custom ASCII banner art
Oh, and if you pine for the ASCII art the standard banner provides, you can always create your own.
There’s actually a custom Spring Boot banner generator available at datenkollektiv.de, which generated the ASCII art below for me:
_____ _ ___ ___ _ _
|_ _| |_ ___/ __| ___ _ ___ _____ _ _/ __(_)__| |___
| | | ‘ \/ -_)__ \/ -_) ‘_\ V / -_) ‘_\__ \ / _` / -_)
|_| |_||_\___|___/\___|_| \_/\___|_| |___/_\__,_\___|
${application.title} ${application.version}
Powered by Spring Boot ${spring-boot.version}
Go check it out if you want to customize your development environment and give it some ASCII flair.