-
Notifications
You must be signed in to change notification settings - Fork 876
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
[Q] How to log JSON to console and get cloudwatch logs pick up correct metadata? #194
Comments
you're saying that query works with pino but not winston... At a guess I'd say cloudwatch is parsing the At any rate - typically we recommend using pino style transports https://github.com/pinojs/pino/blob/master/docs/transports.md but the Can't help with |
hi, yes it works with pino. my setup is like this: i use pino to print to console and has fluentd ship the logs to cloudwatch (batch ship, retry, etc..) however, for another project at work, we use winston and cloudwatch doesn't pick up the metadata correctly so i was wondering what pino does differently. I tried asking in winstonjs project but no answer just yet so I thought i might try it here. |
My answer is: migrate to Pino at work. The deadness of the Winston project is one of the factors that drove me to look for alternatives. For example, look at the long idle time on their PR number 835 and the lack of work on the associated issue. |
@jsumners i guess it' the sensible thing to do. Thanks |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This is more like a question of how pino does it.
Output:
I have fluentd daemon to pickup container stdout and ship it to cloudwatch.
In the example above, cloudwatchlogs can detect the metadata correctly from pino and I will be able to query the log like this
However, winston console is not working like that and everything got push to log attribute.
Does anyone know how to fix this. I'm using winston console with
json: true
andstringify: true
Ref: winstonjs/winston#985
The text was updated successfully, but these errors were encountered: