Photo by Jon Tyson on Unsplash

How to Customize Spring Boot Banner

Erkan Güzeler
echoHub
Published in
2 min readJan 5, 2020

--

Hi everyone,

In this article, l will show you how to change spring boot default banner.
You always see the default spring Banner in the console when the Spring application start.

Default Spring Boot Banner

Most of time you want to change it or you want to add details of your projects in the beginning of the console.

That’s very simple to change the banner. You only add a banner.txt to your resources.

resources directory

The application will be load automatically when the application run. Unlike txt, the application also supports different image types like PNG, JPG, JPEG.
But I always use .txt format and ASCII art , because it is text based and the application easily load and render it. I recommend you to use.

Let’s create a banner and add your logo. I have added ASCII ART text generared by patorjk.com.

Generated Ascii Art sample banner.

The supported colors;

  • ${Ansi.NAME}
  • ${AnsiColor.NAME}
  • ${AnsiBackground.NAME}
  • ${AnsiStyle.NAME}

You can check it out ansi color.

Colored Ascii Art filled text
Colourful spring banner.

That’s it. You change everytime your banner easily in the spring boot application. You can change easily your banner.

Finally, if you do not want to see the banner on the console, you can write the following command to your application.properties file.

spring.main.banner-mode=off

I hope you enjoy when reading…

Have a nice coding.

References

--

--