Pretty print JSON output of Spring Boot Actuator endpoints

前端 未结 14 999
终归单人心
终归单人心 2020-12-24 12:30

Spring Boot Actuator provides several endpoints to monitor an application as:

/metrics
/b         


        
14条回答
  •  别那么骄傲
    2020-12-24 13:11

    As per http://docs.spring.io/spring-boot/docs/current/reference/html/howto-spring-mvc.html#howto-customize-the-jackson-objectmapper, the official way to enable pretty print with Jackson in Spring Boot (1.2.2 at least) is to set the following property:

     # Pretty-print JSON responses
     spring.jackson.serialization.indent_output=true
    

提交回复
热议问题