Skip to content
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

how to log tracing::error with a custom message #865

Closed
evbo opened this issue Apr 26, 2024 · 6 comments
Closed

how to log tracing::error with a custom message #865

evbo opened this issue Apr 26, 2024 · 6 comments

Comments

@evbo
Copy link

evbo commented Apr 26, 2024

I only receive the following non-descript error logs, despite calling tracing::error! with more specifics:

{
    "time": "2024-04-26T23:09:32.311Z",
    "type": "platform.initRuntimeDone",
    "record": {
        "initializationType": "on-demand",
        "phase": "init",
        "status": "error",
        "errorType": "Runtime.ExitError"
    }
}

Example of how I call tracing:

let err_info = format!("Something very very bad happened");
tracing::error!(name: "invalid_input", "Invalid input: {}", err_info);
@bnusunny
Copy link
Contributor

bnusunny commented Apr 27, 2024

This is a Lambda system log. Your function crashed during init and didn't reach your logging code.

@evbo
Copy link
Author

evbo commented Apr 27, 2024

@bnusunny you're very right about that!

So I set the new "advanced" log level to Error thinking I would see errors... but only after setting it to Info did it finally print the problem:

/var/task/bootstrap: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /var/task/bootstrap)

Why would that be an INFO log?!!! :)

Or is this an AWS bug I'm ranting about?

@pbintcha
Copy link

@bnusunny you're very right about that!

So I set the new "advanced" log level to Error thinking I would see errors... but only after setting it to Info did it finally print the problem:

/var/task/bootstrap: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /var/task/bootstrap)

Why would that be an INFO log?!!! :)

Or is this an AWS bug I'm ranting about?

I fix this GLIBC_2.28 not found error by updating the lambda runtime to Amazon Linux 2023

@evbo
Copy link
Author

evbo commented Apr 30, 2024

@pbintcha I fixed it by switching to musl arm target during build (instead of using --arm64). Cool idea upgrading I'll try that.

@bnusunny
Copy link
Contributor

bnusunny commented May 1, 2024

Newer Lambda runtimes are based on Amazon Linux 2023 with glibc 2.34. Older Lambda runtimes are based on Amazon Linux 2 with glibc 2.26. You can find out the OS version for each runtime here.

@bnusunny bnusunny closed this as completed May 1, 2024
Copy link

github-actions bot commented May 1, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants