The spring.main.banner-mode property controls where Spring Boot prints its startup banner. It accepts three values: console (the default, prints to standard output), log (writes the banner through the logging system) and off (prints nothing). Set it in application.properties, application.yml, as a command-line argument, or in code with SpringApplication.setBannerMode().
The property only controls where, or whether, the banner appears. What the banner contains is controlled separately by a banner.txt file or an image, as described below.
| Value | Behaviour |
|---|---|
console | Prints the banner to System.out. This is the default. |
log | Writes the banner to the configured logger instead of standard output. |
off | Disables the banner completely. |
Set the mode in application.properties:
Or in application.yml:
Quote off in YAML. Unquoted, YAML 1.1 parsers read off as the boolean false, and Spring Boot's own documentation uses the quoted form. You can also override it at launch without rebuilding:
Command-line arguments and environment variables (SPRING_MAIN_BANNER_MODE=off) take precedence over property files, which suits per-environment control.
console suits local development, where the banner is a quick visual marker that the app started.log is useful when stdout is not captured but logs are, or when you want the banner timestamped and routed with the rest of the application's log output.off keeps container and production logs clean, especially when logs are parsed as JSON or by line-based tools, where a multi-line ASCII banner is noise. It also avoids a few lines of output in short-lived CLI or batch applications.By default Spring Boot prints its own logo with the version. To replace it, add a banner.txt file to src/main/resources.
The file can use placeholders resolved at startup:
${application.version} and ${application.formatted-version} from MANIFEST.MF${application.title} from the manifest${spring-boot.version} and ${spring-boot.formatted-version}${AnsiColor.GREEN}, ${AnsiStyle.BOLD} and ${AnsiColor.DEFAULT} for colours and stylesThe application title and version placeholders are filled only when the app runs from a packaged JAR whose manifest contains them; they may be empty when you run from an IDE.
Point Spring Boot to another file with spring.banner.location, and set the encoding with spring.banner.charset if it is not UTF-8:
Spring Boot can also convert an image to ASCII art. Place banner.gif, banner.jpg or banner.png on the classpath, or set spring.banner.image.location. If both an image and a text banner exist, both are printed, image first. The original text-only advice that a YAML file can be a banner is incorrect: banners are plain text or images, not YAML.
You can configure the mode and even the banner itself with SpringApplication, which is useful for tests or small tools.
Banner.Mode has the values OFF, CONSOLE and LOG, matching the property. Alternatively, use the fluent builder: new SpringApplicationBuilder(MyApplication.class).bannerMode(Banner.Mode.OFF).run(args).
Values set in code are defaults. Properties from the environment are applied afterwards, so spring.main.banner-mode set externally can still override them.
spring.main.banner-mode and that a profile-specific file is not overriding it.log mode: the banner is logged at INFO level under org.springframework.boot.SpringApplication, so make sure that logger is not set higher.banner.txt as UTF-8 or set spring.banner.charset.console. The banner is printed to standard output unless you change the mode.
Set spring.main.banner-mode=off in your properties file, pass it as a command-line argument, or call setBannerMode(Banner.Mode.OFF) in code.
No. It only suppresses output at startup. All other startup logging continues as configured.
Yes. Add banner.txt or an image to src/main/resources, or set spring.banner.location to another file.
spring.main.banner-mode chooses between console, log and off for the startup banner, with console as the default. Combine it with banner.txt, spring.banner.location or an image banner to control the content, and use off in production when you want clean, machine-readable logs.