title: Spring Boot Logging and Google Cloud Platform Log Viewer
body: <p>I'm running a Spring Boot application within the Google Cloud Platform and viewing the log files viewing the Google Platform Logs Viewer. Before using Spring Boot and just using simple servlets, the logging entries would be displayed as:</p>
  
  <p><a href="https://i.stack.imgur.com/6xicM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6xicM.png" alt="Logs are grouped and show the blue information icon"></a></p>
  
  <p>Each request would be grouped and all the logging information for that request could be seen by expanding the row. However, when using Spring Boot the requests are no longer grouped and the log entries are just shown line by line. When there are multiple requests the log entries get very confusing as a result because it isn't possible to view them in a grouped way. I have my logging.properties setup in the same way:</p>
  
  <pre><code>.level = INFO
  handlers=java.util.logging.ConsoleHandler
  java.util.logging.ConsoleHandler.level=FINEST
  java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
  java.util.logging.SimpleFormatter.format = [%1$tc] %4$s: %2$s - %5$s %6$s%n
  </code></pre>
  
  <p>The Logger is initialised in each class as:</p>
  
  <pre><code>private static final java.util.logging.Logger LOG = java.util.logging.Logger.getLogger(MyClass.class.getName());
  </code></pre>
  
  <p>And then the logging API is used as:
  LOG.info("My Message");</p>
  
  <p>I don't understand why the statements are being logged differently and no longer grouped but it must have something with the way Spring Boot handles logging?</p>