#Structured logging

7 messages · Page 1 of 1 (latest)

faint fable
#

What are the best practices for doing structured logging for Workers?

https://developers.cloudflare.com/workers/observability/logpush

This article seems to be the only resource but it only talks about unstructured console.logs()

What should I do? Integrate a third-party service / do my own little implementation of sending structured JSON logs to some storage?

Cloudflare Logpush supports the ability to send Workers Trace Event Logs to a supported destination. Worker’s Trace Events Logpush includes metadata …

slender cipher
#

You can pass an object to console.log which you'd see in the LogPush/Tail Worker logs

faint fable
#

hmm then the docs are not so clear

#

because if json can be added and it’s parses too so not a stringified blob then doing structured logging is easy

#

What does the following limit mean for json?

#

“Message size: Maximum of 300 characters per log line”