How to turn off Spring logo at the start up of my SpringBoot application?
At the starting of my SpringBoot application, I am getting the following spring logo in my console.
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.6.RELEASE)
How to turn this off without much code changes?
1 Answer
5 years ago by Eleven
There are several ways you can tun off the SpringBoot banner.
1. Turn off using configuration in application.properties
file ( easiest way )
If you are already using the application.properties
in your application then great all you need to do is just add the following line to your application.properties
file
spring.main.banner-mode=off
If you do not have application.properties
in your application then simply create a new one in src/main/resources
2. Turn off in SpringBootApplication Main method using code
Use the following code to start your SpringBoot application. Notice you are setting the Banner.Mode.OFF
which turn off the SpringBoot banner while starting.
package com.oc.springsample;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Start {
public static void main(String[] args) {
SpringApplication app = new SpringApplication(Start.class);
app.setBannerMode(Banner.Mode.OFF);
app.run(args);
}
}
5 years ago by Karthik Divi