-
-
Notifications
You must be signed in to change notification settings - Fork 967
Add versions to banner #15229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 7.1.x
Are you sure you want to change the base?
Add versions to banner #15229
Conversation
e03070e to
bf6d4dd
Compare
sbglasius
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What a great idea 😄
|
Can the java-version show what distribution it comes from (Amazon, Belsoft, Oracle, etc?) To answer myself: |
|
Something like this: #15230 |
|
looks nice, but I wonder I wonder if it should also display when banner is off? In all my apps, I have been using log.info "${Metadata.current['info.app.name']} v${Metadata.current['info.app.version']} (Java ${System.getProperty('java.version')} Groovy ${GroovySystem.getVersion()} Grails ${Metadata.current['info.app.grailsVersion']} Spring Boot ${SpringBootVersion.version} Spring ${SpringVersion.version})"because it is useful for troubleshooting to know what versions you are running. I have banner off because I don't want to fill my logs with a banner (especially when I am running multiple instances). Or have a separate setting to display it if banner is off? |
No need to store the versions or use resolvers. They are only used in the `printBanner` method.
ce8ede9 to
fb59c77
Compare
| def versions = [ | ||
| (environment.getProperty('info.app.name') ?: 'application'): environment.getProperty('info.app.version') ?: 'unknown', | ||
| 'JVM': System.getProperty('java.vendor') + ' ' + System.getProperty('java.version'), | ||
| 'Grails': BuildSettings.grailsVersion, | ||
| 'Groovy': GroovySystem.version, | ||
| 'Spring Boot': SpringBootVersion.version, | ||
| 'Spring': SpringVersion.version | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: If this was split out into a protected method, it would be possible for anyone to extend the GrailsBanner and the list, with information from CI/CD etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbglasius See updated PR description.
- Allow overriding behavior - Add conditional output of art and versions
@codeconsole See updated PR description, will this accommodate your use case? |
Will by default output versions below banner like:
Behavior can be overridden:
and the individual parts can be disabled with config properties: