I’d recommend divorcing log aggregation from your application entirely and instead just dump logs to stdout
. That’s about the fastest you’re ever going to get outside of doing something stragely clever like caching the log messages in-memory and emitting them after the response via middleware (ew). That’d be kinda dangerous since you won’t get any logs in the event of a failure or a service being killed.
Once you’re logging to stdout, you can set up a separate service to consume those logs and aggregate them. In Kubernetes-land, this is pretty standard practice and you can get off-the-shelf solutions like Grafana or the ELK stack to help you with it all, but if you’re foregoing K8s in favour of something like Render, I’m not sure how that’d work honestly. If that setup will allow you to stream to stdout/console and let you hook another service up to consume that stream, then I suppose the effect would be the same.