Setting custom banner on spring application startup

Опубликовано: 17 Март 2022
на канале: Tech with Monir
481
8

In a Spring Boot application, a banner is a graphical image or text that is displayed on the console when the application is launched. By default, Spring Boot displays a banner that includes the Spring logo and the version of Spring Boot that is being used.

The banner is displayed by the SpringApplication class, which is the main class that is used to launch a Spring Boot application. You can customize the banner by specifying a different banner file or by disabling the banner altogether.

To specify a different banner file, you can add a file called banner.txt to the src/main/resources directory of your project. The file should contain the text and graphics that you want to use for the banner. The text can include placeholders for system properties and application properties, which will be replaced with their actual values when the banner is displayed.

To disable the banner, you can add the following property to the application.properties file in the src/main/resources directory of your project:

Copy code
spring.main.banner-mode=off
Alternatively, you can disable the banner programmatically by calling the setDefaultBannerMode method of the SpringApplication class and passing the Banner.Mode.OFF constant as an argument.

Overall, the banner in a Spring Boot application is a graphical image or text that is displayed on the console when the application is launched. You can customize the banner by specifying a different banner file or by disabling the banner altogether.

This video shows how to create your custom spring banner and set it on startup of spring embedded server
follow the link below to prepare your own banner

Learn spring boot now:    • Custom Properties & Profile Configura...  


Смотрите видео Setting custom banner on spring application startup онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Tech with Monir 17 Март 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 481 раз и оно понравилось 8 людям.