Skip to main content

How to disable the Spring boot logo banner at startup

There are mainly 3 ways to disable the spring boot logo banner at startup.

Spring boot logo banner

1- Pro-grammatically

SpringBootDemoApplication.java

package in.tecmentor;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class SpringBootDemoApplication {
	
	public static void main(String[] args) {
		SpringApplication springApp = new SpringApplication(SpringBootDemoApplication.class);
		springApp.setBannerMode(Banner.Mode.OFF);
		springApp.run(args);
	}
}

Note-
There are 3 possible Banner.Mode availables:
OFF – Disable printing spring boot startup banner from console and log files.
CONSOLE – Print the spring boot startup banner only to console.
LOG – Print the spring boot startup banner only to the log file.


2- Using properties file

application.properties

spring.main.banner-mode=off

application.yml

spring:
  main:
    banner-mode: "off"

3- Using command line arguments

Command Prompt

java -Dspring.main.banner-mode=off -jar SpringBootDemoApplication-1.0.jar

Let me know if any further question related to disabling spring boot logo banner at startup.


References

  1. Customizing spring boot banner

Leave a Reply

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

Top