<p>All my logs ERROR/WARNIN are mapped as INFO at Stackdriver.
I'm using logback and Im running my application in a Kubernetes cluster.</p>

<p>How can I setup my logback to Stackdriver?</p>

<p>Tks</p>

Marcos Vidolin
<p>The Stackdriver logging agent configuration for Kubernetes defaults to INFO for any logs written to the container's stdout and ERROR for logs written to stderr. If you want finer-grained control over severity, you can configure Spring to log as single-line JSON (e.g., via <code>JsonLayout</code><sup>1</sup>) and let the logging agent pick up the severity from the JSON object (see <a href="https://cloud.google.com/logging/docs/agent/configuration#process-payload" rel="nofollow noreferrer">https://cloud.google.com/logging/docs/agent/configuration#process-payload</a>).</p>

<p><sup>1</sup>By default, <code>JsonLayout</code> will use "level" for the log level, while the Stackdriver logging agent <a href="https://cloud.google.com/logging/docs/agent/configuration#special-fields" rel="nofollow noreferrer">recognizes</a> "severity", so you may have to override <code>addCustomDataToJsonMap</code>.</p>

<p>See also <a href="https://stackoverflow.com/questions/44164730/gke-stackdriver-java-logback-logging-format">GKE &amp; Stackdriver: Java logback logging format?</a></p>
