前言
大家可以把logo自定义为自己喜欢的内容
一、Springboot原logo展示
二、关闭logo和修改logo
1.关闭log0
代码如下(示例):
@SpringBootApplication
public class Demo1Application {
public static void main(String[] args) {
//我们先把主启动类的启动语句注释掉
// SpringApplication.run(Demo1Application.class, args);
/**
* 1.我们重新写一条启动语句,相当于把原来的启动语句拆分开
* SpringApplication application = new SpringApplication(Demo1Application.class);
*
* 2.通过application对象中的setBannerMode();方法可以修改logo的配置
* setBannerMode()方法参数是枚举类型:其中Banner.Mode.OFF是关闭logo
* Banner.Mode.CONSOLE
* Banner.Mode.LOG
*/
SpringApplication application = new SpringApplication(Demo1Application.class);
application.setBannerMode(Banner.Mode.OFF);
/*
* 1.applicationContext是Spring容器,可以从中获取Bean对象
* 2
* */
ConfigurableApplicationContext applicationContext = application.run(args);
}
}
测试结果:启动的时候已经没有logo了
2.修改logo
1.直接在resources目录下新建一个banner.txt文件即可,SpringBoot会把logo替换为banner.txt文件中的内容
2.测试一下