[英]Google container engine logging to Stackdriver Error Reporting
I'm currently trying to log errors to Stackdriver Error Reporting from Google Container Engine. 我目前正在尝试将错误记录到Google Container Engine的Stackdriver Error Reporting中。 I'm using the built-in fluentd-based Stackdriver Logging agent from GKE which works great.
我使用的是GKE内置的,基于Fluentd的Stackdriver Logging代理,效果很好。 However, when I log an error according to the specification( https://cloud.google.com/error-reporting/docs/formatting-error-messages ), I do not see it appear in Stackdriver Error Reporting
但是,当我根据规范记录错误时( https://cloud.google.com/error-reporting/docs/formatting-error-messages ),我看不到它出现在Stackdriver Error Reporting中
The payload I see in Stackdriver Logging is 我在Stackdriver Logging中看到的有效负载是
{
insertId: "xatjb4fltv246"
jsonPayload: {
stream: "event"
message: "path was incorrect"
environment: "production"
event_type: "RAILS_ERROR"
context: {
path: "/2",
reportLocation: {
functionName: "foo"
filePath: "/something.js"
lineNumber: 3
}
request_id: "3149e5c4-3192-4a9c-a123-b4dedf5a9e07"
}
timestamp: 1492205840
serviceContext: {
service: "nambrotdotcom"
}
}
resource: {…}
timestamp: "2017-04-14T21:37:20Z"
severity: "INFO"
labels: {…}
logName: "projects/nambrotdotcom/logs/web"
}
If I understand correctly, this should be fine? 如果我理解正确,应该没问题吗?
EDIT: 编辑:
I logged a manual error according to the trouble shooting page and it worked fine. 我根据故障排除页面记录了一个手动错误,并且工作正常。 The only difference I see between the error I manually logged and the payload I logged from GKE is that the logname and labels are different, but that shouldn't be a factor?
我看到的手动记录的错误和我从GKE记录的有效负载之间的唯一区别是,日志名称和标签不同,但这不应该是一个因素吗?
Error Reporting is looking for severity ERROR
or higher, but will also consider DEFAULT
in most cases. 错误报告正在寻找严重性为
ERROR
或更高的ERROR
,但在大多数情况下也会考虑使用DEFAULT
。 The problem is the severity: "INFO"
value in the log entry. 问题是
severity: "INFO"
日志条目中的severity: "INFO"
值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.