-
Notifications
You must be signed in to change notification settings - Fork 16
Description
I am using RedwoodJS on Netlify functions for our app, and so I need to use the pino logtail transport for logging.
I noticed recently that logs are going missing, especially when they are at the end of a chain of calls to a lambda function. I fixed this by a) implementing my own Writable stream which sends to Betterstack using @logtail/node - this is because I suspected that transports might be the problem as they run in a different thread b) awaiting logtail.flush() after any of my lambdas are complete.
Is there a way to resolve this without all the custom code? I tried using pino.flush() but I don't think it's actually calling logtail.flush(), and I think that's the problem (i.e. it might not be pino transports that are the issue). I see that logtail.flush is called in closeFunc in the transport, but I don't think that gets called on pino.flush().