While the documentation give the way to create a file properties with all informations (build.info). https://docs.spring.io/spring-boot/how-to/build.html#howto.build.generate-info

The code doesn't take into consideration those informations. https://github.com/spring-projects/spring-boot/blob/00440b982cc9124ebc1f48862063f47b18bf660f/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/StartupInfoLogger.java#L103-L115

The code seems to have changed tho I am using springboot 3.3.3. However, it seems that build.info properties are completely ignored even now.

https://github.com/spring-projects/spring-boot/issues/41604

Regarding the application name there is also a properties : spring.application.name wondering if that properties is not better than the class name to determine the application name.

Comment From: wilkinsona

Sorry, I don't think I understand the problem that you're reporting. The BuildProperties bean that is auto-configured from a build-info.properties file is, and always has been, separate from the information that's logged when the application starts up. BuildProperties cannot be used, even if we wanted to do so, as beans are not available at this early point in the application's startup.

Can you please clarify what you expected to happen and why you had those expectations, for example linking to documentation that says that the contents of the build-info.properties would be used by the startup info logging?

Comment From: alexisgayte

BuildProperties cannot be used, even if we wanted to do so, as beans are not available at this early point in the application's startup.

gotcha, make sense.

Can you please clarify what you expected to happen and what you had those expectations, for example linking to documentation that says that the contents of the build-info.properties would be used by the startup info logging?

To be honest I was just expecting to have the info from build-info printed somewhere. somewhere in the log I was looking for : build name / build version / etc . It would have make sense to have it at startup.

Using the class name seems strange if you have spring.application.name as properties. And not having the spring.application.name printed is strange as well. For example my log line looks like : "Starting Application using Java xxx" with class name Application.class (pretty useless)

I was expecting to have build.info that is explicitly generated to get this information to be used by default if no version or no name was present. Or to be able to set spring.application.version = ${build.version} or spring.application.version = ${build.version} (${build.commit})

After another look at it the documentation doesn't say anything about using build-info information. And may be, it doesn't make sense to use them as build can be different than application. Yet from actuator perspective that is the only information that are shown by default (I would assume application and version should be there as default). build version / build name.

Comment From: philwebb

I've opened #42324 to consider logging a bit more. In the meantime, you can use a custom banner.txt if you want and where you should be able to use ${<variable>} to access any property in the Spring Environment.

Comment From: alexisgayte

Thanks, banner.txt is a bit overkilled for my need, also as you said BuildProperties is not loaded at that time. I've just created a log line from a bean creation with BuildProperties.

After more thought about it, I think this log is fine as it show low level information from the startup of what is running etc. I think I was confused probably due to previous spring version and the banner that show Spring boot version(3.3.3) which is an higher level. I was somehow expected the application name + version after.

Here is the start up :

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v3.3.3)

11:22:11.878 [main] INFO  xxx.Application - Starting Application using Java 17.x.x with PID 76xx (/xx/xxx/xxx/xx/main started by xxxx in /xxx/xxx)
11:22:11.884 [main] INFO  xxx.Application - The following 1 profile is active: "xxx"

Perhaps the "appendApplicationName"[Application] should not be stripped of .class and all higher level information should be printed with the profile line. like version. You can also keep the wording consistent with the code (Running vs Starting) SpringApplication.run(Application.class, args); Like :

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v3.3.3)

11:22:11.878 [main] INFO  xxx.Application - Running Application.class using Java 17.x.x with PID 76xx (/xx/xxx/xxx/xx/main started by xxxx in /xxx/xxx)
11:22:11.884 [main] INFO  xxx.Application - Starting "Application name" "version" ("commit") with the following 1 profile is active: "xxx"

Just an idea.