Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to disable spring boot logo in stdout?

Is there a way to disable the lovely but very visible ASCII Spring boot logo :

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

...dumped in STDOUT every time your run a spring boot app?

I switched all logging to ERROR in my logback.xml, but that did nothing:

<root level="ERROR">     <appender-ref ref="STDOUT" /> </root> 

edit: It's not called a "Logo" in the documentation. The search-friendly-term is a "banner".

like image 778
Fabien Benoit-Koch Avatar asked Oct 27 '14 10:10

Fabien Benoit-Koch


People also ask

How do I stop a Spring Boot banner?

Change Banner Text Another way to disable the Spring Boot startup banner is to change the banner text to an empty file.

What is ${} in Spring Boot?

Spring Boot - Using ${} placeholders in Property Files. ☰ LOGICBIG.


1 Answers

http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-banner

new SpringApplicationBuilder()     .showBanner(false)     .sources(Parent.class)     .child(Application.class)     .run(args); 

Edit In the newer versions of spring boot(current is 1.3.3) the way to do it is:

1) application.properties

spring.main.banner-mode=off

2) application.yml

spring:     main:         banner-mode: "off" 

3) main method

public static void main(String[] args) {     SpringApplication app = new SpringApplication(MySpringConfiguration.class);     app.setBannerMode(Banner.Mode.OFF);     app.run(args); } 

Docs

Edit:

To change this with and environment variable use the property with underscore instead of dot. Try:

SPRING_MAIN_BANNER-MODE=off

See the docs for externalized config.

like image 190
Evgeni Dimitrov Avatar answered Sep 21 '22 18:09

Evgeni Dimitrov