private String collectEnvironmentInfo(final Environment environment, final Class<?> sourceClass) {
        val properties = System.getProperties();
        if (properties.containsKey("CAS_BANNER_SKIP")) {
            try (val formatter = new Formatter()) {
                formatter.format("CAS Version: %s%n", CasVersion.getVersion());
                return formatter.toString();
            }
        }

        try (val formatter = new Formatter()) {
            val sysInfo = SystemUtils.getSystemInfo();
            sysInfo.forEach((key, v) -> {
                if (key.startsWith(SEPARATOR_CHAR)) {
                    formatter.format("%s%n", LINE_SEPARATOR);
                } else {
                    formatter.format("%s: %s%n", key, v);
                }
            });
            formatter.format("%s%n", LINE_SEPARATOR);
            injectEnvironmentInfo(formatter, environment, sourceClass);
            ServiceLoader.load(BannerContributor.class)
                .stream()
                .forEach(clz -> clz.get().contribute(formatter, environment));
            formatter.format("%s%n", LINE_SEPARATOR);
            return formatter.toString();
        }
    }
Collect environment info with
details on the java and os deployment
versions.

@param environment the environment
@param sourceClass the source class
@return environment info
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/spring/boot/AbstractCasBanner.java