如何在标准输出中禁用Spring Boot徽标? [英] how to disable spring boot logo in stdout?
问题描述
有没有一种方法可以禁用可爱但非常明显的ASCII Spring引导徽标:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.1.8.RELEASE)
...每次运行spring boot应用程序时都会将其转储到STDOUT中吗?
我在logback.xml中将所有日志记录都切换为ERROR,但是什么也没做:
<root level="ERROR">
<appender-ref ref="STDOUT" />
</root>
在文档中未将其称为徽标".搜索友好术语是横幅".
3)主要方法 文档 >
要使用和环境变量更改此属性,请使用带下划线而不是点的属性.试试: SPRING_MAIN_BANNER-MODE =关闭 请参见 docs 进行外部配置. Is there a way to disable the lovely but very visible ASCII Spring boot logo : ...dumped in STDOUT every time your run a spring boot app? I switched all logging to ERROR in my logback.xml, but that did nothing: edit: It's not called a "Logo" in the documentation. The search-friendly-term is a "banner". http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-banner Edit
In the newer versions of spring boot(current is 1.3.3) the way to do it is: 1) application.properties 2) application.yml 3) main method Edit: To change this with and environment variable use the property with underscore instead of dot. Try: SPRING_MAIN_BANNER-MODE=off See the docs for externalized config. 这篇关于如何在标准输出中禁用Spring Boot徽标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!public static void main(String[] args) {
SpringApplication app = new SpringApplication(MySpringConfiguration.class);
app.setBannerMode(Banner.Mode.OFF);
app.run(args);
}
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.1.8.RELEASE)
<root level="ERROR">
<appender-ref ref="STDOUT" />
</root>
new SpringApplicationBuilder()
.showBanner(false)
.sources(Parent.class)
.child(Application.class)
.run(args);
spring.main.banner-mode=off
spring:
main:
banner-mode: "off"
public static void main(String[] args) {
SpringApplication app = new SpringApplication(MySpringConfiguration.class);
app.setBannerMode(Banner.Mode.OFF);
app.run(args);
}