How to change default banner text in Spring Boot


In this tutorial, you will learn how to change the default Spring Boot banner text with your own custom banner text. When you execute your Spring Boot application, you might notice that there is a fancy “Spring” text printed in the console log.

Spring Boot custom banner

You can override/replace the default “Spring” banner text with your custom text by following the below steps:

Similar Post: Spring Boot- Disable Spring banner at startup

Step 1: Design your custom banner or generate it from any online source. I have used Spring Boot banner.txt generator to create the custom banner.

,--.   ,--.         ,--.                                                                 
|  |   |  |  ,---.  |  |-.   ,---.   ,---.   ,--,--. ,--.--. ,--.--.  ,---.  ,--.   ,--. 
|  |.'.|  | | .-. : | .-. ' (  .-'  | .-. | ' ,-.  | |  .--' |  .--' | .-. | |  |.'.|  | 
|   ,'.   | \   --. | `-' | .-'  `) | '-' ' \ '-'  | |  |    |  |    ' '-' ' |   .'.   | 
'--'   '--'  `----'  `---'  `----'  |  |-'   `--`--' `--'    `--'     `---'  '--'   '--' 
                                    `--'

Step 2: Open your Spring Boot application and create a banner.txt file inside the src/main/resources directory.

Spring Boot custom banner project structure

Step 3: Copy & paste the created/generated banner text in banner.txt file.

Step 4: Restart the Spring Boot application and see the console log, it will start printing custom banner text.

console.log
,--.   ,--.         ,--.                                                                 
|  |   |  |  ,---.  |  |-.   ,---.   ,---.   ,--,--. ,--.--. ,--.--.  ,---.  ,--.   ,--. 
|  |.'.|  | | .-. : | .-. ' (  .-'  | .-. | ' ,-.  | |  .--' |  .--' | .-. | |  |.'.|  | 
|   ,'.   | \   --. | `-' | .-'  `) | '-' ' \ '-'  | |  |    |  |    ' '-' ' |   .'.   | 
'--'   '--'  `----'  `---'  `----'  |  |-'   `--`--' `--'    `--'     `---'  '--'   '--' 
                                    `--'                                                 
2022-03-26 13:56:18.290  INFO 103080 --- [           main] o.w.SpringBootBannerApplication          : Starting SpringBootBannerApplication using Java 11.0.12 on ATUL with PID 103080 (F:\sts4-workspace\spring-boot-banner\target\classes started by Atul in F:\sts4-workspace\spring-boot-banner)
2022-03-26 13:56:18.292  INFO 103080 --- [           main] o.w.SpringBootBannerApplication          : No active profile set, falling back to 1 default profile: "default"
2022-03-26 13:56:18.605  INFO 103080 --- [           main] o.w.SpringBootBannerApplication          : Started SpringBootBannerApplication in 0.541 seconds (JVM running for 1.133)

References

  1. Customizing the Banner
  2. Spring Boot Security- Change default username and password parameter
  3. Spring Boot Security- How to change default login page

Similar Posts

About the Author

Atul Rai
I love sharing my experiments and ideas with everyone by writing articles on the latest technological trends. Read all published posts by Atul Rai.