title: Pretty print output of Spring Boot Actuator JMX endpoints
body: <p>I have a Spring Boot console application and I access the actuator endpoints over JMX. The problem is that the returned text is not pretty-printed and it's not JSON. It looks something like this:</p>
  
  <pre><code>{context=application, parent=null, beans=[{bean=helloWorldApplication, scope=singleton, type=com.surpreso.spring_skeleton.HelloWorldApplication, resource=null, dependencies=[helloWorldService]}, {bean=helloWorldService, scope=singleton, type=com.surpreso.spring_skeleton.HelloWorldService, resource=file [C:/src-tmp/spring-skeleton/target/classes/com/surpreso/spring_skeleton/HelloWorldService.class], dependencies=[]}, {bean=com.surpreso.spring_skeleton.DefaultConfig,  ...
  </code></pre>
  
  <p>What the best way to get this into a readable format? Is it possible to configure the JMX actuator to pretty-print? Is it possible to configure the JMX actuator to use JSON?</p>
  
  <p>There's a related question about <a href="https://stackoverflow.com/questions/24503790/pretty-print-json-output-of-spring-boot-actuator-endpoints">Pretty print JSON output of Spring Boot Actuator endpoints</a>, but in this case I'm stuck with JMX because I don't have a web application. As the next step I'll try CRaSH, but I was curious if I can configure the JMX actuator to be more usable.</p>
  
  <p>I'm using version 1.2.5 of Spring Boot.</p>
  
  <p><strong>UPDATE</strong>: The CRaSH implementation uses the same format, so it's not a solution.</p>
  
  <p><strong>UPDATE 2</strong>: I see <a href="https://github.com/spring-projects/spring-boot/commit/becbc00a4d4d093d273adae17026dacf3a5aaebf" rel="nofollow noreferrer">this</a> commit in 1.3.0 about "Use configured ObjectMapper, if available, in all EndpointMBeans" but I don't know what properties to set for pretty printing. It's close ...</p>
  
  <p><strong>UPDATE 3</strong>: <code>spring.jackson.serialization.indent_output=true</code> did not have any effect through the CRaSH interface. I'm on 1.3.0.M2 now.</p>