title: Zap stack traces vs. error messages on google cloud
body: <p>I'm using zapp to log error messages on a service hosted on google cloud, and am seeing that while errors are logged successfully, the text stored in the "message" field of the google cloud log is the stack trace, and not the error message I have logged.</p>
  
  <p>Example code:</p>
  
  <pre><code>var log *zap.Logger
  if err := doStuff(); err != nil {
      log.Error(&lt;error message I want to log&gt;, zap.Error(err))
  }
  </code></pre>
  
  <p>This works well except google cloud logging and stackdriver will use the stack-trace caught by the call to <code>zap.Error</code> in the <code>message</code> field of the structured log. The message I've defined appears in the <code>msg</code> field, but the former appears to be the one displayed predominantly in the logging console and used by stackdriver for indexing errors. </p>
  
  <p>This means that when navigating logs and errors via the console, I only see stacktraces, and no indication of the associated error string.</p>
  
  <p>The tricky thing is I have no idea if this "issue" is cloud-side or zapp-side. I've spent some time digging around in Zapp to no avail, and am out of ideas.</p>