简体   繁体   English

UnhandledPromiseRejectionWarning:错误:大小为 903.1K 的日志条目超过最大大小 256.0K

[英]UnhandledPromiseRejectionWarning: Error: Log entry with size 903.1K exceeds maximum size of 256.0K

I am having the following error (appeared twice only in last 12hours): (node:7) UnhandledPromiseRejectionWarning: Error: Log entry with size 903.1K exceeds maximum size of 256.0K我遇到以下错误(仅在过去 12 小时内出现两次):(节点:7)UnhandledPromiseRejectionWarning:错误:大小为 903.1K 的日志条目超过最大大小 256.0K

I am using the @google-cloud/logging-bunyan": "^1.2.3" library on nodeJS 8.16.1 to log the google map autocomplete response.我正在使用 nodeJS 8.16.1 上的 @google-cloud/logging-bunyan": "^1.2.3" 库来记录 google map 自动完成响应。
Sometimes the logs can be bigger than 256K which is the max quota for Stackdriver.有时日志可能大于 256K,这是 Stackdriver 的最大配额。 So, it causes the following problem:因此,它会导致以下问题:

(node:7) UnhandledPromiseRejectionWarning: Error: Log entry with size 903.1K exceeds maximum size of 256.0K
    at Http2CallStream.call.on (/usr/src/app/node_modules/@grpc/grpc-js/build/src/client.js:96:45)
    at Http2CallStream.emit (events.js:203:15)
    at process.nextTick (/usr/src/app/node_modules/@grpc/grpc-js/build/src/call-stream.js:75:22)
    at process._tickCallback (internal/process/next_tick.js:61:11)  

according to this link, the problem is in the Stackdriver quota: https://github.com/googleapis/nodejs-logging/issues/520根据此链接,问题出在 Stackdriver 配额中: https://github.com/googleapis/nodejs-logging/issues/520

But after visiting the documentation i have seen that the max value of log size is 256K: https://cloud.google.com/logging/quotas但在访问文档后,我发现日志大小的最大值为 256K: https://cloud.google.com/logging/quotas

Is there a way to resolve this problem?有没有办法解决这个问题?

The Stackdriver Log Entry Size constitutes a hard limit, which has already been extended from 100KB to 256KB (See posts on Public Issue Tracker and Release Notes ). Stackdriver 日志条目大小构成硬限制,已从 100KB 扩展到 256KB(请参阅Public Issue TrackerRelease Notes上的帖子)。

To facilitate the situation, I recommend you to exclude unnecessary logs in order to minimize the size of the file.为了方便这种情况,我建议您排除不必要的日志以最小化文件的大小。 (See Log Exclusions and Preventing Log Waste ). (请参阅日志排除防止日志浪费)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM