Skip to content

Improve logging output #19

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

Merged
merged 2 commits into from
Apr 17, 2023
Merged

Conversation

joe4dev
Copy link
Member

@joe4dev joe4dev commented Apr 14, 2023

Make init log levels configurable

Lambda container logs are very verbose such that it is hard for customers to identify what’s wrong with their Lambda implementation because the logs are mainly about RIE internals.

We already support log levels through the environment variable LOCALSTACK_INIT_LOG_LEVEL but only debug and trace is insufficient.

Go log levels: https://github.com/sirupsen/logrus#level-logging

What should be the default level? "warn + invocation result logging"

Follow Up

  • Add invocation result logging from PrintEndReports (currently only sent to CloudWatch)
  • Investigate / clean up warning printed upon every invocation:
2023-04-14 12:25:37 time="2023-04-14T10:25:37Z" level=warning msg="Reset initiated: SandboxTerminated" func=go.amzn.com/lambda/rapid.handleReset file="/Users/joe/Projects/LocalStack/lambda-runtime-init/lambda/rapid/start.go:589"

joe4dev added 2 commits April 14, 2023 12:50
* Support levels from Logrus
* Adjust xray logging accordingly
@joe4dev joe4dev requested a review from dominikschubert April 17, 2023 08:28
Copy link
Member

@dominikschubert dominikschubert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, the new default level seems to be a sensible balance between clarity and verbosity 👍

As discussed, in the future we should look into introducing more control over stdout/stderr and also printing the platform messages (START/END/REPORT, ..)

@joe4dev joe4dev merged commit b87667e into localstack Apr 17, 2023
@joe4dev joe4dev deleted the support/make-logging-levels-configurable branch April 17, 2023 09:56
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

Successfully merging this pull request may close these issues.

2 participants