![](/img/trans.png)
[英]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.