Quarkus: Allow extensions to disable the banner

Created on 28 May 2020  路  5Comments  路  Source: quarkusio/quarkus

Description
When working on Google Cloud Function support, I find the banner not displayed correctly.
They uses there own logging system (JUL) and the banner is displayed when the Quarkus ends and not when Quarkus starts !

Moreover, logs are available on a web console where a banner don't make a lot of sense.

Implementation ideas
Allow extensions to publish a build item that will disable the banner.

kinenhancement

All 5 comments

You should be able to do this today:

Just create a RunTimeConfigurationDefaultBuildItem with quarkus.banner.enabled as the key and false as the value and it should work.

You should be able to do this today:

Just create a RunTimeConfigurationDefaultBuildItem with quarkus.banner.enabled as the key and false as the value and it should work.

We should probably add this in this guide https://github.com/quarkusio/quarkus/blob/master/docs/src/main/asciidoc/writing-extensions.adoc

I'll let @loicmathieu do that after he confirms it actually does work :)

The following code do the trick:

    @BuildStep
    public RunTimeConfigurationDefaultBuildItem disableBanner(){
        // the banner is not displayed well inside the Google Cloud Function logs
        return new RunTimeConfigurationDefaultBuildItem("quarkus.banner.enabled", "false");
    }

Regarding the extension author guide, it misses a lot of documentation about all the various build items that we can use ...
It don't know where to put this one ... maybe inside the configuration section explaining how we can control other extension configuration ?
By the way, this is for runtime configuration, can we also control build time one ?

This trick will only work for runtime configuration, it's only good for setting a default (this is essentially the same as defaultValue of ConfigItem does)

Was this page helpful?
0 / 5 - 0 ratings