title: Dump Spring boot Configuration
body: <p>Our Ops guys want the Spring boot configuration (i.e. all properties) to be dumped to the log file when the app starts. I assume this can be done by injecting the properties with annotation @ConfigurationProperties and printing them. </p>
  
  <p>The questions is whether there is a better or built-in mechanism to achieve this. </p>
  
  <p>Given there does not seem to be a built in solution besides, I was try to cook my own. Here is what I came up with:</p>
  
  <pre><code>@Component
  public class ConfigurationDumper {
  
  
      @Autowired
      public void init(Environment env){
          log.info("{}",env);
      }
  
  }
  </code></pre>
  
  <p>The challenge with this is that it does not print variables that are in my application.yml. Instead, here is what I get:</p>
  
  <pre><code>StandardServletEnvironment 
  {
      activeProfiles=[],
      defaultProfiles=[default],
      propertySources=[
          servletConfigInitParams,
          servletContextInitParams,
          systemProperties,
          systemEnvironment,
          random,
          applicationConfig: [classpath: /application.yml]
      ]
  }
  </code></pre>
  
  <p>How can I fix this so as to have all properties loaded and printed?</p>