Skip to content

Print the java version being used on startup #21559

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

Closed
wants to merge 2 commits into from

Conversation

dreis2211
Copy link
Contributor

Hi,

this PR closes #21553 by using System.getProperty("java.version"). Alternatively, we could check for Runtime.version() being available (which is the case for JDK 9+) and use that.

Cheers,
Christoph

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 25, 2020
@snicoll snicoll added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels May 25, 2020
@snicoll snicoll added this to the 2.4.x milestone May 25, 2020
@wilkinsona wilkinsona self-assigned this Jun 2, 2020
@wilkinsona
Copy link
Member

Thanks for the PR, @dreis2211. Here's what's logged by StartupInfoLoggerTests#sourceClassIncluded with the proposed changes:

Starting StartupInfoLoggerTests on fulcrum.local with PID 42978 (started by awilkinson in /Users/awilkinson/dev/spring-projects/spring-boot/master/spring-boot-project/spring-boot) on Java 1.8.0_252

I wonder if the Java version should appear earlier in the message. I also wonder about the two uses of on, one to refer to the host and the other to the JVM.

What do you think of something like the following:

Starting StartupInfoLoggerTests using Java 1.8.0_252 on fulcrum.local with PID 42978 (started by awilkinson in /Users/awilkinson/dev/spring-projects/spring-boot/master/spring-boot-project/spring-boot)

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Jun 2, 2020
@dreis2211
Copy link
Contributor Author

Funny enough, I had a similar version before (with with instead of using but hey) and I too find the double on sub-optimal. I decided to append it at the end to less likely break it for anyone parsing this log statement - (I've seen people do this for startup statistics).

I'm totally fine with what you suggested. Let me know if I should change it.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jun 2, 2020
@wilkinsona
Copy link
Member

@dreis2211 Thanks. Given that this will go into 2.4, I'm comfortable with the small risk of breaking someone's log message parsing. It's an easy one for them to correct and we don't make any guarantees about the structure of any of our messages.

I have a slight preference for using rather than with to avoid duplicating the with in with PID ….

If you have a moment to make the updates, that'd be great. Thank you.

@dreis2211
Copy link
Contributor Author

@wilkinsona Sure. Done.

@wilkinsona wilkinsona modified the milestones: 2.4.x, 2.4.0-M1 Jun 5, 2020
@wilkinsona
Copy link
Member

Thanks again, @dreis2211.

wilkinsona pushed a commit that referenced this pull request Jun 5, 2020
@wilkinsona wilkinsona closed this in 2f06cbc Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: feedback-provided Feedback has been provided type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Print the java version being used on startup
5 participants