#Is there a preferred/best-practice approach to verbose logging on the Node.js server?

3 messages · Page 1 of 1 (latest)

dusk steppe
#

We have a ISR Next.js setup running in Google Kubernetes Engine in Google Cloud with a persistent volume serving up built static files to two client pods. Every once in awhile (once a month it seems) a situation arises where the static files build fine, but a 404 is getting returned to the web client for the static chunk being requested. We are able to monitor logs from the API backend, but the logging for the Node.js server seems quite sparse. Some info we are interested in capturing:

  1. All requests to the Node.js server
  2. Every time the Node.js server has to restart
  3. Anytime a response is served up from any sort of Node.js-touching cache

Are there any best practices to logging --verbose to stdout for the Node.js server?

open timberBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

night magnet
#

I don't think so. I've dug into this before and it looks like their OpenTelemetry instrumentation is the only "recommended" way to get any sort of observability out of the framework.

Let me know if you come up with any useful info, I've been looking to implement something similar.

Maybe writing a custom opentelemetry processor and using @opentelemetry/sdk-trace-node 's ConsoleSpanExporter is viable but idk much about otel.