如何在stdout中禁用Spring Boot徽标?
如何在stdout中禁用Spring Boot徽标?
有没有方法可以禁用Spring Boot很可爱但非常明显的ASCII标志:
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v1.1.8.RELEASE)
...每次运行Spring Boot应用程序时都会在STDOUT中打印出来?
我在我的logback.xml中将所有日志记录切换为ERROR,但没有任何作用:
编辑:在文档中它不被称为“标志”。 可以使用“横幅”这个搜索友好的术语。
admin 更改状态以发布 2023年5月21日
http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-banner
new SpringApplicationBuilder() .showBanner(false) .sources(Parent.class) .child(Application.class) .run(args);
Edit
在较新版本的Spring Boot中(当前为1.3.3),方法如下:
1)application.properties文件中:
spring.main.banner-mode=off
2)application.yml文件中:
spring: main: banner-mode: "off"
3)主方法:
public static void main(String[] args) { SpringApplication app = new SpringApplication(MySpringConfiguration.class); app.setBannerMode(Banner.Mode.OFF); app.run(args); }
编辑:
要使用环境变量来更改此设置,请使用下划线代替点的属性。例如:
SPRING_MAIN_BANNER-MODE=off
有关外部配置,请参阅文档。