Open mpkorstanje opened 1 year ago
Note that cloud environments will no longer be deduced automatically starting from Micronaut 4. So perhaps a better solution is to restrict banner display if Environment.DEVELOPMENT
is running.
That said, disabling the banner is literally a one-liner, so I'd consider this low priority
It's not quite a one liner. It is a one liner per application, so I'm looking at 25+ of these.
But I would not mind sending a pull request if that takes care of the low priority.
Would a configuration property help in your case? (eg micronaut.banner.enable = false
).
You could set it in a ConfigMap and make it available to all the 25+ services at once.
A property could be made to work.
Are all properties available before applicationContext.start();
has been invoked? And if not, would printing the banner after the application has already started be much of a problem?
Are all properties available before
applicationContext.start();
has been invoked?
That is what the bootstrap
context is for. Have a look at https://micronaut-projects.github.io/micronaut-kubernetes/latest/guide/#config-client
Feature description
The problem
The current banner implementation is not a log statement. When used in a cloud environment this causes a little bit of grief by default. And while this problem is relatively easy to work around it doesn't feel Natively Cloud Native.
Context
We are currently logging with the ELK stack and using the Logstash Logback Encoder. This means all our logs are effectively in newline delimited json format. So our logs look like this:
While we'd usually view this in Kibana which will happily ignore anything that can't be parsed, sometimes we have to look into the logs on Kubernetes directly. And to make these readable we'd use
jq
. For exampleThat of-course didn't work unless we filter out the first 8 lines.
And this is kinda annoying.
Proposed solution
When a cloud environment is detected the banner should not be printed. Instead it should be replaced with a log statement containing the Micronaut version.
Workaround
As a work around we disabled the Micronaut banner.