I'm using SpringBoot 2.1 with the spring-boot-maven-plugin
and git-commit-id-plugin
to automatically populate the actuator info endpoint with the build information. Works great. I'm getting the values grouped under the json properites build
and git
.
Now I also want to include these information in the json formatted log messages (using logback logstash). Therefore I tried using the springProperty
extension, but it seems that these elements are not available as environment entries.
<springProperty scope="context" name="info_version" source="info.build.version"/>
<springProperty scope="context" name="build_version" source="build.version"/>
I both cases nothing gets resolved. I also tried to add the build-info.properties
as a property source manually by
@PropertySource("classpath:META-INF/build-info.properties")
...but this doesn't seem to work neither.
Thus, how can I include properties like the build-version, git-commit or something else from info entries in the log messages?