-
Notifications
You must be signed in to change notification settings - Fork 381
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
Unrecognized JSON log error #261
Comments
Hi @guillaume-gc 👋 thanks for sharing! This is probably a duplicate of #253 :) Thanks for sharing the logs as well! There seems to be some kind of problem with the JSON formatting (is it multi-line?). What kind of logger are you using? Is it Lambda Power Tools? Could you please share the raw logs? (without formatting or multi-line) Context: Lambda Power Tuning assumes that there is one log per line (separated by |
Hi @alexcasalboni! You're welcome! Apologies if it's a duplicate, it seems the error message is a bit different so I couldn't find it. I'm using Lambda Power Tools with TypeScript to manage logs. In the CloudWatch console, the logs have the same format as in this issue. I'm unsure whether Lambda Power Tools formats the logs in this manner before sending them to CloudWatch, or if the CloudWatch console automatically formats all JSON logs to improve user experience. I've viewed the logs in plain text, and nothing changed, which suggests that it may be the former. 🤷 One important detail is that I've successfully used your tool on some of my lambda functions before, which also have Lambda Power Tools with (I believe) the same configuration for logging. If the issue is only caused by sending logs with line breaks inside, which is something Lambda Power Tools seems to do, I suppose it would have occurred sooner? I've also ""solved"" this issue by adjusting the logging level to |
@guillaume-gc ah, that's interesting! is it possible that DEBUG logs are prettified intentionally to improve the debugging experience? 🤔 |
@alexcasalboni as far as I know, no this is not the case. Here is an example of a INFO log, still in plain text:
As you can see, it's also prettified. Same with ERROR or WARNING log message. The only difference I see between logs that are causing the issue and those who are not is the prettified array, and the error message also only included an array closing bracket (and no opening bracket). It could just be coincidental of course, I don't have enough examples to check for a real pattern. |
Hey @alexcasalboni and @guillaume-gc , the error has nothing to do with the log format. The problem seems to be that the actual |
@patmeiler mmm and why would that happen? Is there an alternative field on its place? Or it's just missing entirely? |
@alexcasalboni in the code, we invoke the Lambda by using the |
I'm experimenting with this tool, which is amazing! Unfortunately, I'm getting this error:
Here is some context, with all information redacted:
I assume the issue is caused by the
]
character?Here is log that appears to be causing the issue:
Here is the Step Functions input, without the
payload
key:The text was updated successfully, but these errors were encountered: