Logging on server
I've been looking into how I can handle logging all server-side errors using pino (primiarly in the defaultStreamHandler as I have errors that are not serialized in console)... I want to use standard logging format so GCP Cloud Run can pick up on it but at the moment everything is automatically console.<insert-method>.
Are there plans to allow injecting a logger (similar to Fastify => https://fastify.dev/docs/latest/Reference/Server/#loggerinstance).
Server | Fastify
Factory
6 Replies
flat-fuchsiaOP•8mo ago
In short term to solve the readable issue, I added this to SSR.tsx
I figured out how to debug/find issue.
rare-sapphire•8mo ago
that's a good idea. can you please create a github issue for the logger injection?
flat-fuchsiaOP•8mo ago
👍
flat-fuchsiaOP•8mo ago
Created an RFC discussion: https://github.com/TanStack/router/discussions/3286
GitHub
RFC: Custom logger on the start server · TanStack router · Discussi...
Problem Currently all of the server-side logging is done via good ole' console but I'd like to be able to use a dedicated logger across the board. This would allow developers to hook into l...
rival-black•4mo ago
@Zac in your rfc, you mention this could just be a nitro plugin.
do you mean something like:
services/logger.ts
plugins/nitro.logger.ts
flat-fuchsiaOP•4mo ago
yes but I'm not super familiar with nitro and I know there are rumbles about removing it
I think for now we are holding until start is a bit futher along to tackler
take on*