zoukankan      html  css  js  c++  java
  • springboot 定制启动图案

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

    图案输出有以下几种模式,默认是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

    也可以通过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)

      

  • 相关阅读:
    01-2制作U盘启动盘--装机助理工具
    01-1制作U盘启动盘--大白菜超级U盘启动盘制作工具
    计算机操作系统
    设置电脑系统密码以及桌面密码
    bios文字解释
    Word基本文档字体设置
    Ctrl/Alt 快捷键
    Windows键
    Laravel 5.2 四、.env 文件与模型操作
    Laravel 5.2 三、中间件、视图与 Blade 模板引擎
  • 原文地址:https://www.cnblogs.com/qinxu/p/14201815.html
Copyright © 2011-2022 走看看