Creating colorful Banners for Spring Boot Applications

5

Often it is nice if a service provides its own banner. Then you can easily recognize the start of the service, even when you just take a quick glimpse. Its even nicer if the banner could provide colors, just in case you have a log or a terminal that supports colored output. With the release 1.3.0 of Spring Boot it is possible to display colorful banners.

For my Chatty demo, I quickly created a banner using an ASCII art generator, like http://patorjk.com/software/taag/#p=display&f=Graffiti&t=Chatty. if you save it in a file named banner.txt and put it under src/main/resources, it would be displayed like:

chatty-banner1

With a little bit of ANSI colors I got

chatty-banner2

You find the current Chatty banner.txt here.

If you want to have it really colorful, you could create a banner like

chatty-banner3

You find the source for the above banner.txt here.

All in all, it was fun creating a new banner for my Spring Boot based demo service.

 

5 Comments

  1. SeB
    SeB12-15-2015

    That is interesting, but you don’t say how to implement a new banner with spring-boot, please give a link at least.
    thank you.

    • Kai Tödter
      Kai Tödter12-16-2015

      SeB, you just have to create a text file ‘banner.txt’ and place it under src/main/resources. That’s all :). If you want to add ANSI colors, you can place statements like ${AnsiColor.BRIGHT_BLUE} in the banner.txt.

  2. This Week in Spring – December 15th, 2015 | Alexius DIAKOGIANNIS
    This Week in Spring – December 15th, 2015 | Alexius DIAKOGIANNIS12-16-2015

    […] Learn about Spring Boot 1.3’s new support for colored banners […]

  3. This Week in Spring, December 16 | JAVA
    This Week in Spring, December 16 | JAVA12-17-2015

    […] Learn about Spring Boot 1.3’s new support for colored banners […]

Leave a Reply