Comment

Comment by georgekin

Another option is to log after, but in a cross cutting way, e.g. using a middleware or filter. Extra properties can be added along the way, and if there's an exception the middleware can handle it and add the problem to the log event.

The power of structured logging here is in enriching events to make them queryable later, so you could e.g. view all events for a request.

parent georgekin 5 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton