-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nothing happens... #41
Comments
Hello? I finally used this module to capture stdout from my script, but I was hoping to use this programmatically. |
I guess this project is dead... |
I ran into the same problem and was about to throw my hands up in frustration and jump to Winston, but I poked around with a debugger and figured this out. In case anyone else ends up here... The problem is that pino-cloudwatch will buffer logs and only send them to cloudwatch when one of the following three conditions is met:
If you don't specify an cloudwatchStream({
group: CLOUDWATCH_NODEJS_LOG_GROUP,
aws_access_key_id: AWS_ACCESS_KEY_ID,
aws_secret_access_key: AWS_SECRET_ACCESS_KEY,
aws_region: AWS_REGION,
interval: 1000, // This is required.
}) Note that this will make it so every time you send a log to pino-cloudwatch, it will wait 1000ms before sending. If you log another message in that interval, the timer will reset. If you log something every 900ms, your logs will not get sent until you reach one of the other conditions - you could be waiting a couple of hours. As this package is currently written, there's no fix for this - there's no option to specify a "maximum interval between sends". |
I've created a fork to fix some issues and eventually port it to TypeScript: https://www.npmjs.com/package/pino-aws-cloudwatch Looking forward to PRs. |
@jwalton I tried your solution but it does not work:
I'm using pino v8.11.0. |
I made a package myself using streams and works great. I'll try to publish it once I have some free time. |
@demian85 can you share the config you did to make the connection with cloudWatch please? |
in another file...
Nothing gets logged, no error, no nothing. What is happening? How can I debug this thing?
Thanks.
The text was updated successfully, but these errors were encountered: