google-cloud-platformgoogle-cloud-stackdrivergoogle-cloud-error-reporting

How to get Error logs to appear in Stack Driver Error Reporting?


I am having difficulties integrating with Stackdriver Error Reporting.

When using the stack driver log viewer I can see that it has correctly identified it as an error event due to the orange '!!' on the log line.

The logs are coming from a Java Application in a pod on Kubernetes. I am using SLF4J and logback to control my logging. I realise this is not the example in the docs which suggest fluentd however I would like to avoid changing my logging across all applications.

Following the troubleshooting guide I am able to submit a log line that is picked up and also directly report an error. This makes me think the issue must be permissions related. I have tried adding the "Error Reporting Admin" role onto the compute engine default service account and onto Kubernetes Engine Service Agent but this has not worked.

Am I missing something?


Solution

  • The !! in the logs viewer means that the LogEntry.severity field has a value of ERROR (which is provided by the client that wrote the entry). Entries that land in Error Reporting need to meet a few other criteria: https://cloud.google.com/error-reporting/docs/formatting-error-messages

    You might also be interested in the details on how errors are grouped together: https://cloud.google.com/error-reporting/docs/grouping-errors

    The "Error Reporting Admin" role would allow someone (or a service account) to perform actions like muting an error group. There are no permissions requirements to get data from logging into Error Reporting.