#SpringBoot
在启动时打印的横幅可以通过添加
banner.txt文件或者banner.gif、banner.jpg或banner.png图像文件
到你的类路径或设置spring.banner.location
或spring.banner.image.location
属性指向该文件的位置;
可以通过spring.banner.charset
设置字符编码;
图像被转换成ASCII艺术表示,并打印在任何文本标题之上。
Banner 表
如果你想以编程的方式生成横幅,则可以使用SpringApplication.setBanner(…)方法,使用org.springframework.boot.Banner接口和实现你自己的printBanner()方法。
banner.txt
${AnsiColor.BRIGHT_BLUE}
__ __ ________ ___ __ __ ______ ________
/_/\/_/\ /_______/\/__//_//_/\ /_____/\ /_______/\
\ \ \ \ \\__.::._\/\::\| \| \ \\::::_\/_ \__.::._\/
\:\_\ \ \ \::\ \ \:. \ \\:\/___/\ \::\ \
\::::_\/ _\::\ \__\:.\-/\ \ \\::___\/_ _\::\ \__
\::\ \ /__\::\__/\\. \ \ \ \\:\____/\/__\::\__/\
\__\/ \________\/ \__\/ \__\/ \_____\/\__JiaoMa\/
${AnsiColor.BRIGHT_GREEN}
${AnsiColor.DEFAULT}
复制代码
当然我们也可以关掉 Banner
public static void main(String[] args) {
SpringApplication app = new
SpringApplication(MySpringConfiguration.class);
app.setBannerMode(Banner.Mode.OFF);
app.run(args);
}
复制代码