Springboot Banner Settings at startup

Source: Internet
Author: User

For developers who have used spring boot, the output of the character spring symbol is not unfamiliar when the program starts. This is the spring boot design for banner:

1.. ____          _            __ _ _

2./\\/___ _ __ _ _ (_) _ __ _ \ \ \ \ \ \

3. (() \___ | ' _ | ' _| | ' _ \ _ ' | \ \ \ \

4. \\/___) | |_) | | | | | | |  (_| | ) ) ) )

5. ' |____| __|_| |_|_| |_\__, | / / / /

6. =========|_|==============|___/=/_/_/_/

7.:: Spring Boot:: (v1.3.3.release)

If someone doesn't like the output, this article explains how to modify it.

The first way: when modifying, set, in the main method of application:

Springapplication application = new springapplication (App.class);

/*

* Banner.Mode.OFF: Off;

* Banner.Mode.CONSOLE: Console output, default mode;

* Banner.Mode.LOG: Log output mode;

*/

Application.setbannermode (Banner.mode. OFF);

Application.Run (args);

Second way: Modify the Banner.txt configuration file

Create a new Banner.txt under src/main/resouces and add it to the file:

#这个是MANIFEST the version number in the. mf file

${application.version}

#这个是上面的的版本号前面加v后上括号

${application.formatted-version}

#这个是springboot的版本号

${spring-boot.version}

#这个是springboot的版本号

${spring-boot.formatted-version}

The Third Way: rewrite interface banner implementation

Springboot provides an interface Org.springframework.boot.Banner, whose instance can be passed to Springapplication's Setbanner (Banner) method. If you're not busy. To beautify this command-line output, you can override the Printbanner method of the banner interface.

Fourth Way: Configure in Application.properties

Display and shutdown of banner in Application.proerpties:

# # # Displays banner, selectable values [True|false]

Spring.main.show-banner=false

Springboot Banner Settings at startup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.