How To Disable Spring Boot Banner

By Yashwant Chavan, Views 2610, Last updated on 14-Apr-2019

This spring boot article will help to disable the default Banner which is displayed while executing the spring application class.

tags spring-boot spring-banner

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

2014-09-24 08:44:15.183  INFO 5772 --- [           main] com.technicalkeeda.Application           : Starting Application on swami-samartha with PID 5772 (C:\javaworkspace\SpringBootExamples\bin started by swami in C:\javaworkspace\SpringBootExamples)
2014-09-24 08:44:15.211  INFO 5772 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1835282: startup date [Wed Sep 24 08:44:15 IST 2014]; root of context hierarchy
...............
...............
...............

Disable the Spring Banner

Just set the setShowBanner() as false value. It will turn off the banner from console log. Even you can customize the banner as per your application name, that we will cover later on.

package com.technicalkeeda.bean;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableAutoConfiguration
@ComponentScan
public class Application {
    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(Application.class);
        app.setShowBanner(false);
        app.run(args);
    }
}

output

2014-09-26 09:28:27.063  INFO 7068 --- [           main] com.technicalkeeda.bean.Application      : Starting Application on swami-samartha with PID 7068 (C:\javaworkspace\SpringBootExamples\bin started by swami in C:\javaworkspace\SpringBootExamples)
2014-09-26 09:28:27.094  INFO 7068 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@64c34e: startup date [Fri Sep 26 09:28:27 IST 2014]; root of context hierarchy
....................
....................
....................
2014-09-26 09:28:29.756  INFO 7068 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080/http
2014-09-26 09:28:29.757  INFO 7068 --- [           main] com.technicalkeeda.bean.Application      : Started Application in 2.968 seconds (JVM running for 3.197)

Yashwant

Yashwant

Hi there! I am founder of technicalkeeda.com and programming enthusiast. My skills includes Java,J2EE, Spring Framework, Nodejs, PHP and lot more. If you have any idea that you would want me to develop? Lets connect: yashwantchavan[at][gmail.com]