Spring Boot – How to disable the Spring logo banner

Home / Spring Boot / Spring Boot – How to disable the Spring logo banner

A Spring Boot application prints a banner during startup. This banner can be customized. Here are few ways to disable the Spring logo banner below :

.   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.1.RELEASE)

Solution

1. SpringApplication main method.

package com.miemha;

import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class SpringBootConsoleApplication {

public static void main(String[] args) throws Exception {

   SpringApplication app = 
      new SpringApplication(SpringBootConsoleApplication.class);
   app.setBannerMode(Banner.Mode.OFF);
   app.run(args);

   }
}

There are 3 Banner.Mode

  • OFF – Disable printing of the banner.
  • CONSOLE – Print the banner to System.out.
  • LOG – Print the banner to the log file.

2. Application properties file

application.properties

spring.main.banner-mode=off

3. Application YAML file.

application.yml

spring:
  main:
    banner-mode:"off"

4. Pass as a system property

terminal

$ java -Dspring.main.banner-mode=off -jar spring-boot-simple-1.0.jar

Leave a Reply

Your email address will not be published. Required fields are marked *