APISonar


org.springframework.boot.Banner.Mode.LOG

> org > springframework > boot > Banner > Mode > LOG
org APIs springframework APIs boot APIs Banner APIs Mode APIs LOG APIs

Example 1
public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {
    if (BANNER_MODE == Banner.Mode.OFF) {
      return;
    }
    String bannerText = this.buildBannerText();
    if (BANNER_MODE == Mode.CONSOLE) {
      System.out.print(bannerText);
    } else if (BANNER_MODE == Mode.LOG) {
      logger.info(bannerText);
    }
  }
Example 2
public static void main(String[] args) {
        SpringApplication app = new SpringApplication(ApplicationStarter.class);
        app.setAdditionalProfiles();
        app.setBannerMode(Banner.Mode.LOG);
        app.run(args);
    }
Example 3
private Banner printBanner(ConfigurableEnvironment environment) {
		if (this.bannerMode == Banner.Mode.OFF) {
			return null;
		}
		ResourceLoader resourceLoader = (this.resourceLoader != null)
				? this.resourceLoader : new DefaultResourceLoader(getClassLoader());
		SpringApplicationBannerPrinter bannerPrinter = new SpringApplicationBannerPrinter(
				resourceLoader, this.banner);
		if (this.bannerMode == Mode.LOG) {
			return bannerPrinter.print(environment, this.mainApplicationClass, logger);
		}
		return bannerPrinter.print(environment, this.mainApplicationClass, System.out);
	}