springboot学习-关闭默认的banner及自定义banner解析

本文介绍了如何在SpringBoot中关闭默认的启动Logo(Banner),提供了两种方法:修改main方法和调整yml配置文件。同时,解析了SpringBoot默认Banner的生成原理,并指导如何自定义创建banner.txt文本或支持gif、jpg、png格式的图片。
摘要由CSDN通过智能技术生成

sprinboot默认是开启banner的,如下图:

如果不想输出logo,可以通过以下两种方法来关闭:

1.修改main方法

public class SpringbootstudyApplication {

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

	}

2.修改yml文件

spring:
  main:
    banner-mode: "off"

注意:双引号一定要加,否则报

 Cannot convert value of type 'java.lang.Boolean' to required type 'org.springframework.boot.Banner$Mode' for property 'bannerMode': no matching editors or conversion strategy found]

默认的banner为什么会

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值