[英]Error using Google Stackdriver Logging in App Engine Standard python
[英]Google container engine logging to Stackdriver Error Reporting
我目前正在尝试将错误记录到Google Container Engine的Stackdriver Error Reporting中。 我使用的是GKE内置的,基于Fluentd的Stackdriver Logging代理,效果很好。 但是,当我根据规范记录错误时( https://cloud.google.com/error-reporting/docs/formatting-error-messages ),我看不到它出现在Stackdriver Error Reporting中
我在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"
}
如果我理解正确,应该没问题吗?
编辑:
我根据故障排除页面记录了一个手动错误,并且工作正常。 我看到的手动记录的错误和我从GKE记录的有效负载之间的唯一区别是,日志名称和标签不同,但这不应该是一个因素吗?
错误报告正在寻找严重性为ERROR
或更高的ERROR
,但在大多数情况下也会考虑使用DEFAULT
。 问题是severity: "INFO"
日志条目中的severity: "INFO"
值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.