Skip to content
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

Consider showing more information in StartupInfoLogger #42330

Open
philwebb opened this issue Sep 16, 2024 · 4 comments
Open

Consider showing more information in StartupInfoLogger #42330

philwebb opened this issue Sep 16, 2024 · 4 comments
Labels
status: pending-design-work Needs design work before any code can be developed type: enhancement A general enhancement
Milestone

Comments

@philwebb
Copy link
Member

See #42324 for background.

Since StartupInfoLogger was first introduced we've added more features that could be useful to log. The application.name and application.version could be useful as could the git SHA if it's available.

We need to be a little careful not to add too much information and not to change the defaults in a way that folks won't like.

@philwebb philwebb added status: waiting-for-triage An issue we've not yet triaged for: team-meeting An issue we'd like to discuss as a team to make progress status: pending-design-work Needs design work before any code can be developed and removed status: waiting-for-triage An issue we've not yet triaged for: team-meeting An issue we'd like to discuss as a team to make progress labels Sep 16, 2024
@philwebb philwebb added this to the 3.x milestone Sep 18, 2024
@philwebb
Copy link
Member Author

We like the idea of at least logging the application name, if we can do it without adding too much noise.

@Dunemaster
Copy link

My two cents:
I would vote for logging application version as well. It is very useful when receiving logs from client om-premise installations.
Version extraction can be implemented in several ways (maybe with a configurable provider). We implemented extracting version from the JPMS module version, this seems to be a reasonable default.

One of the stackoverflow answers show how to add a module version using maven https://stackoverflow.com/questions/48151160/does-jpms-support-module-version

The official docs:
https://docs.oracle.com/en/java/javase/17/docs/specs/man/jar.html (see --module-version)

And in app code the version can be retrieved like this

System.out.println("Hello, modular World!");
Module module = HelloModularWorld.class.getModule();
ModuleDescriptor descriptor = module.getDescriptor();
System.out.println(descriptor.rawVersion());

@brightview4578
Copy link

@philwebb Hi Philip, I can create a PR for logging the application name and version. Could you please assign this issue to me?

@wilkinsona
Copy link
Member

Thanks for the offer, @sonu4578, but as indicated by the issue being labelled as "pending design work", we're not ready to accept contributions for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: pending-design-work Needs design work before any code can be developed type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants