How to create a custom banner for your spring boot application

Carvia Tech | May 24, 2019 | 1 min read | 142 views


Create a Banner Ascii Text using online tool

When we start any spring boot app, it comes up with a default ascii banner. In this tutorial we will learn how to create a custom banner for app startup.

1. Creating Custom Banner

We will use an online Spring Boot Ascii Banner generators to generate custom banner which will be displayed during the application startup.

2. Using Custom Banner

Now since we have created banner text, we need to save this text file with name banner.txt under src/main/resources so that Spring Boot can pick it up and display it at application startup.

Spring Boot by default will pick content from the banner.txt file under resources folder and display it on the startup.

We can customize this behaviour by specifying custom location for banner text, which can be configured in application.properties file using banner.location property.

application.properties
banner.location=classpath:custom-banner.txt
Here is the sample program output
,--.   ,--.         ,--.
|  |   |  |  ,---.  |  |  ,---.  ,---.  ,--,--,--.  ,---.
|  |.'.|  | | .-. : |  | | .--' | .-. | |        | | .-. :
|   ,'.   | \   --. |  | \ `--. ' '-' ' |  |  |  | \   --.
'--'   '--'  `----' `--'  `---'  `---'  `--`--`--'  `----'


2019-05-24 00:03:12.334  INFO 7191 --- [           main] com.shunya.comments.ShunyaApp            : The following profiles are active: dev,default
2019-05-24 00:03:13.185  INFO 7191 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.

Top articles in this category:
  1. Run method on application startup in Spring Boot
  2. Setting a Random Port in Spring Boot Application at startup
  3. Spring Boot 2.0 Reactive Web Performance Metrics
  4. Running Spring Boot app as a service in unix
  5. How will you test web layer in Spring Boot using WebMvcTest annotation?
  6. How to prevent duplicate form submission in Spring MVC
  7. File Upload in Spring MVC using RestTemplate with ByteArrayResource & FileSystemResource



Find more on this topic:
Spring Framework image
Spring Framework

Spring Framework - MVC, Dependency Injection, Spring Hibernate, Spring Data JPA, Spring Boot and Spring Cloud for Microservices Architecture.

Last updated 1 month ago


Recommended books for interview preparation:

This website uses cookies to ensure you get the best experience on our website. more info