转载自 Spring Boot定制启动图案

启动图案

Spring Boot在启动的时候会显示一个默认的Spring的图案,对应的类为SpringBootBanner。

  1. .   ____          _            __ _ _

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

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

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

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

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

  7. :: Spring Boot ::        (v1.5.6.RELEASE)

图案输出有以下几种模式,默认是CONSOLE的,即只打印到控制台,也可以输出到日志文件。

enum Mode {
    /*** Disable printing of the banner.*/OFF,

    /*** Print the banner to System.out.*/CONSOLE,

    /*** Print the banner to the log file.*/LOG

}

关闭图案

@SpringBootApplication
public class Application {
    public static void main(String[] args) {new SpringApplicationBuilder(Application.class).bannerMode(Banner.Mode.OFF).run(args);}

}

定制图案

很简单,只要在classpath目录下创建banner.txt即可,把图案放入该文件就行,这是Spring Boot默认的图案位置,Spring Boot会自动加载该文件显示图案。

生成图案的网站:http://patorjk.com

也可以使用图片,更详细的可以研究Banner接口及其子类,不过这也没什么卵用,有兴趣的可以深入了解下。

当然也支持通过application配置文件来定制图案。

# BANNER
banner.charset=UTF-8 # Banner file encoding.
banner.location=classpath:banner.txt # Banner file location.
banner.image.location=classpath:banner.gif # Banner image file location (jpg/png can also be used).
banner.image.width= # Width of the banner image in chars (default 76)
banner.image.height= # Height of the banner image in chars (default based on image height)
banner.image.margin= # Left hand image margin in chars (default 2)
banner.image.invert= # If images should be inverted for dark terminal themes (default false)

Spring Boot定制启动图案相关推荐

  1. 这也太让人大开眼界了,你有没有见过的这样spring boot项目启动图案

    话不多说,直接开始正事,喜欢的记得点个收藏 _oo0oo_o8888888o88" . "88(| -_- |)0\ = /0___/`---'\___.' \\| |// './ ...

  2. Spring Boot(18)---启动原理解析

    Spring Boot(18)---启动原理解析 前言 前面几章我们见识了SpringBoot为我们做的自动配置,确实方便快捷,但是对于新手来说,如果不大懂SpringBoot内部启动原理,以后难免会 ...

  3. Spring Boot 设置启动时banner

    Spring Boot项目再启动的时候默认会在控制台输出一个字符banner图案,如下图: 我们可以通过下面的方法关闭启动时显示字符banner图案: 关闭banner方法一: public stat ...

  4. Spring Boot 定制横幅banner与关闭banner

    点此查看全部文字教程.视频教程.源代码 本文目录 1. 啥是banner 2. 定制banner 3. 关闭banner 1. 啥是banner banner者,横幅也,即Spring Boot项目启 ...

  5. Spring Boot的启动流程

    文章目录 Spring Boot Spring Boot概念 Spring Boot的启动流程 1. 构造SpringApplection的实例 2. 调用实例的run方法 Spring Boot启动 ...

  6. 记一次 Spring Boot 项目启动卡住问题排查记录

    点击上方蓝色"程序猿DD",选择"设为星标" 回复"资源"获取独家整理的学习资料! 作者 | 陈凯玲 来源 | https://url.cn ...

  7. spring boot应用启动原理分析

    spring boot quick start 在spring boot 里,很吸引人的一个特性是可以直接把应用打包成为一个jar/war,然后这个jar/war是可以直接启动的,不需要另外配置一个W ...

  8. 【spring boot】启动类启动 错误: 找不到或无法加载主类 com.codingapi.tm.TxManagerApplication 的解决方案

    [spring boot]启动类启动 错误: 找不到或无法加载主类 com.codingapi.tm.TxManagerApplication 的解决方案 导入的一个外部的spring boot项目, ...

  9. Spring Boot————应用启动时的监听机制测试

    引言 本文承接前面的<Spring Boot----Spring Boot启动流程分析>,主要测试一下ApplicationContextInitializer.SpringApplica ...

最新文章

  1. 记忆的天空:智能进化三部曲
  2. 反向传播神经网络 BPNN
  3. 个人密码安全策略 [转载]
  4. paip. 内存占用少的php ide选择评测总结
  5. 【渝粤教育】电大中专电子商务网站建设与维护 (27)作业 题库
  6. Javascript学习之函数(function)
  7. 第十篇 PO核心功能及流程详解
  8. C#开发笔记之13-如何用C#分隔字符串并返回字符串数组?
  9. 中国特种电器灯泡行业市场供需与战略研究报告
  10. 在线XML美化格式化工具
  11. win10家庭版无法安装mysql_Win10安装MySQL
  12. select设置text的值选中(兼容ios和Android)基于jquery
  13. 软件测试必问必背面试题
  14. 豆瓣9.6分,Scala编程圣经第5版隆重来袭
  15. MATLAB 和 Python 建模和仿真
  16. 扫普通二维码打开小程序,可进入体验版
  17. Java使用FFmpeg(自定义cmd)系列之MP4 转码 HLS m3u8 AES128 加密
  18. Python 官方的中文文档
  19. Android Java代码中获取App渠道信息
  20. Minecraft我的世界服务器配置记录

热门文章

  1. Java中关于省略作用域报错问题分析
  2. [C++11]可调用对象包装器function
  3. IntelliJ IDEA中快捷键大全+出现的问题
  4. oracle 取英文排序,Oracle中中文、数字,英文混杂形式的字段进行排序的方法
  5. 6-5 顺序表操作集 (20 分)(创建,查找,插入,删除)以及顺序表的理解
  6. Convex Hull (ACM-ICPC 2018 沈阳赛区网络预赛) 存个公式
  7. 【POI2007】OSI-Axes of Symmetry【计算几何】【manacher】
  8. ARC080F - Prime Flip(贪心,差分,二分图匹配)
  9. CF1037H. Security
  10. P2152 [SDOI2009]SuperGCD