有没有办法在 info 端点上格式化 spring boot 构建信息? [英] Is there a way to format the spring boot build information on the info endpoint?
问题描述
Spring Boot 允许在执行器 /info
端点上公开 git commit 和构建信息.我使用了 1.5.10.RELEASE 集成 用于设置.
Spring Boot allows for exposing git commit and build information on the actuator /info
endpoint. I have used the 1.5.10.RELEASE integration for setting this up.
但是信息端点上的日期被呈现为时间戳:<代码>{git":{提交":{时间":1520441384000,...
However the date on the info endpoint is being rendered as a timestamp:
{"git":{
"commit":{
"time":1520441384000,
...
有没有办法将这种格式自定义为更易读的格式?
Is there a way to customize this format into something more human readable?
推荐答案
根据 https://github.com/n0mer/gradle-git-properties,你可以在你的application.properties中指定格式,例如
According to https://github.com/n0mer/gradle-git-properties, you can specify the format in your application.properties, e.g.
gitProperties {
dateFormat = "yyyy-MM-dd'T'HH:mmZ"
dateFormatTimeZone = "PST"
}
这篇关于有没有办法在 info 端点上格式化 spring boot 构建信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!