Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Cloud Logging rejects entries above 256 KiB outright — they vanish rather // than being truncated — so oversized entries must be reduced before being // written. The agent in front of it cuts sooner: Cloud Run truncates a // stdout line at around 100 KB, mid-string and without a continuation, so // the JSON no longer parses and the entry arrives as an unstructured // textPayload with its status codes and error fields gone. That lower cut // is what the default has to stay under, with headroom for the metadata the // agent adds on the way. DefaultEntryLimit = 64 * 1024 // When an entry exceeds the entry limit, strings above this length are // truncated. DefaultStringLimit = 4 * 1024 // TruncatedKey marks entries that were reduced to fit the entry limit. TruncatedKey = "log.truncated" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
Writer guards an underlying writer against oversized log entries. Each Write call is expected to carry one entry (as slog handlers do). Entries within the limit pass through untouched; oversized ones are reduced by truncating long strings throughout the entry, and, failing that, by falling back to a minimal entry retaining the time, severity, message and error message.
Click to show internal directories.
Click to hide internal directories.