We have a Fastify (Node) app running on a render Web service which outputs logs in a JSON format (default for Fastify which uses pino to handle logs).
Setup is pretty similar to GitHub - render-examples/fastify-hello-world app.
We log some of the 4xx
requests with the Info severity, however log message may an Error phrase.
In effect these are being shown as Errors in the render in-dashboard log:
{"level":30,"time":"2024-01-25T21:43:04.461Z","pid":66,"hostname":"srv-xxx-xxx-xxx","reqId":"req-7g7r","res":{"statusCode":400},"err":{"type":"Error","message":"Validation failed"}}
I am wondering what is the recommended format for output logs that will be correctly parsed by render?
We are thinking about streaming logs to an external provider however I’m not sure severity levels will be correctly parsed.
The docs says:
If you’re using a standard format like
logfmt
orjson
, Render maps thelevel
field to an appropriate syslog priority. Otherwise, Render makes a best effort to parse log levels, defaulting toINFO
.
Does it mean that the expected output is
{"level":30, "message": "..."}
or
{"level":"INFO", "message": "..."}
or any other like RFC5424?
By the way, pino’s severities are defined here: