You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My NODE_ENV is set to production, which sets the pino logging output to JSON, which is logged to AWS CloudWatch.
Update: The environment variable is set, but the logging is not JSON; it's still pretty print.
However, the logs are missing some key pieces of information that I'd like to inject. Specifically: the AWS Request ID, CloudFront (or API Gateway) headers/trace IDs, and GitHub event IDs.
For some reason, the logger was not respecting the NODE_ENV environment variable and I had to set prettyPrint: false explicitly.
I'm still unsure how to inject the Lambda RequestID, since the above is creating the handler globally (i.e. not per invocation), so the typical Lambda context and event objects are not accessible.
I'm creating a Probot app using the sample code, like so:
My
NODE_ENV
is set toproduction
, whichsets the pino logging output to JSON, which is logged to AWS CloudWatch.Update: The environment variable is set, but the logging is not JSON; it's still pretty print.
However, the logs are missing some key pieces of information that I'd like to inject. Specifically: the AWS Request ID, CloudFront (or API Gateway) headers/trace IDs, and GitHub event IDs.
I found this issue that proposes something like:
But I can't figure out where to overwrite (or modify) the pino logger that Probot has already created.
Any ideas on where we could inject this additional info to make Lambda logs more useful?
The text was updated successfully, but these errors were encountered: