mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
add a trace when log size too big
This commit is contained in:
parent
8cd47eec11
commit
7b36156ce6
1 changed files with 2 additions and 0 deletions
|
|
@ -88,6 +88,8 @@ class GcpLoggingTransport extends LoggingWinston {
|
|||
log(info: any, callback: (err: Error | null, apiResponse?: any) => void) {
|
||||
const sizeInfo = JSON.stringify(info).length
|
||||
if (sizeInfo > 250000) {
|
||||
// add a console.trace to help debug
|
||||
console.trace('GCP Logging API payload too large', sizeInfo)
|
||||
info = truncateObjectDeep(info, 5000) as never // the max length for string values is 5000
|
||||
}
|
||||
super.log(info, callback)
|
||||
|
|
|
|||
Loading…
Reference in a new issue