DEV Community

Yonatan Karp-Rudin
Yonatan Karp-Rudin

Posted on • Originally published at yonatankarp.com on

Create your custom Spring Boot app banner

Today, I'd like to share a fun feature of Spring with you. It's not new or crucial, but it's definitely enjoyable!

Normally, when you launch your Spring Boot app, you see a standard banner in the logs like this:

Spring Boot Banner

But have you ever thought about replacing that Spring banner with your own custom banner? If you have, then this article is for you!

To begin, let's visit https://patorjk.com/, a website that helps us create custom text. You can enter the desired text for your log and choose from a variety of fonts. For example:

Custom Text

You can also click the Test All button to explore all the available options.

Now, let's copy our text and place it inside the application under /resources/banner.txt, as shown below:

Copy Custom Text

Next, let's relaunch our app:

Custom Banner

As you can see, our custom banner has been successfully replaced! Great job! :)

If you're using Spring Boot 2, you can even convert images into ASCII art. However, please note that this functionality is deprecated and has been removed in Spring Boot 3.0.0, which was released recently.

To convert images into ASCII art, follow these steps:

  • Add your image to the resources directory. For this article, we'll use the following logo:

sumup logo

  • Add the following configuration to your application.properties or application.yml file to specify the location of your image:
spring:
  banner:
    image:
      location: sumup.png
      height: 20 # can be adjusted to resize your banner
Enter fullscreen mode Exit fullscreen mode
  • Make sure there's no banner.txt file in your resource directory.

Let's run our app again...

Custom Logo

As you can see, our new logo magically appears!

Summary

In this short article, I've shown you how to customize your Spring banner using text or even images (for Spring Boot 2.x.x) in just a few minutes.


Stay updated with my latest thoughts and ideas by registering for my newsletter. Connect with me on LinkedIn or Twitter. Let's stay connected and keep the conversation going!

Top comments (0)