Skip to content

Conversation

@nosan
Copy link
Contributor

@nosan nosan commented Sep 19, 2024

Starting StartupInfoLoggerTests "spring-boot" v1.2.3 using Java 17.0.12 (started by dmytronosan in /Users/dmytronosan/IdeaProjects/spring-boot/spring-boot-project/spring-boot)

Starting AOT-processed StartupInfoLoggerTests "spring-boot" v1.2.3 using Java 17.0.12 with PID 42 (started by dmytronosan in /Users/dmytronosan/IdeaProjects/spring-boot/spring-boot-project/spring-boot)

Starting StartupInfoLoggerTests "spring-boot" v1.2.3 using Java 17.0.12 with PID 42 (started by dmytronosan in /Users/dmytronosan/IdeaProjects/spring-boot/spring-boot-project/spring-boot)

Restored StartupInfoLoggerTests "spring-boot" in 0.0 seconds

Started StartupInfoLoggerTests "spring-boot" in 0.0 seconds (process running for 1.345)

spring.application.name is not present

Starting StartupInfoLoggerTests v1.2.3 using Java 17.0.12 with PID 42 (started by dmytronosan in /Users/dmytronosan/IdeaProjects/spring-boot/spring-boot-project/spring-boot)

gh-42330

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 19, 2024
@nosan
Copy link
Contributor Author

nosan commented Sep 19, 2024

git.commit.id if needed could be fetched by:

private void appendGitCommit(StringBuilder message) {
	append(message, "", () -> {
		String location = this.environment.getProperty("spring.info.git.location", "classpath:git.properties");
		String encoding = this.environment.getProperty("spring.info.git.encoding", "UTF-8");
		Resource resource = this.resourceLoader.getResource(location);
		Properties properties = loadSource(resource, encoding);
		return properties.getProperty("git.commit.id");
	});
}

private Properties loadSource(Resource location, String encoding) throws IOException {
	if (encoding != null) {
		return PropertiesLoaderUtils.loadProperties(new EncodedResource(location, encoding));
	}
	return PropertiesLoaderUtils.loadProperties(location);
}

@nosan nosan changed the title Added spring.application.name to StartupInfoLogger Add spring.application.name to StartupInfoLogger Sep 19, 2024
@wilkinsona
Copy link
Member

Thanks for the proposal, @nosan, but as indicated by the pending-design-work label we're not ready to work on this one until we've done some design work and, unfortunately, we don't have time for that right now. If you'd like to suggest something that contributes to that design effort when it eventually happens, please do so on the issue.

@wilkinsona wilkinsona closed this Sep 20, 2024
@wilkinsona wilkinsona added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 20, 2024
@nosan nosan deleted the 42330 branch October 5, 2024 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: declined A suggestion or change that we don't feel we should currently apply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants