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

fix(logger): invalid time zone environment variables leads to error #2865

Merged

Conversation

daschaa
Copy link
Contributor

@daschaa daschaa commented Jul 31, 2024

Summary

Changes

With this change the time zone argument for the DateFormat in the Logger utility is set to UTC whenever the time zone from the environment variable is not supported (for example :/etc/localtime).

Issue number: closes #2851


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@boring-cyborg boring-cyborg bot added logger This item relates to the Logger Utility tests PRs that add or change tests labels Jul 31, 2024
@pull-request-size pull-request-size bot added the size/M PR between 30-99 LOC label Jul 31, 2024
@daschaa daschaa marked this pull request as ready for review July 31, 2024 10:37
@daschaa daschaa requested review from a team as code owners July 31, 2024 10:37
Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

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

Thank you for the quick PR, and great idea to test the value using existing libraries - I didn't know that method existed.

I've left one minor comment to make the code less verbose, but other than that it's looking good.

packages/logger/src/formatter/LogFormatter.ts Outdated Show resolved Hide resolved
@pull-request-size pull-request-size bot added size/S PR between 10-29 LOC and removed size/M PR between 30-99 LOC labels Aug 1, 2024
@github-actions github-actions bot added the bug Something isn't working label Aug 1, 2024
@dreamorosi dreamorosi self-requested a review August 1, 2024 14:39
Copy link

sonarqubecloud bot commented Aug 1, 2024

Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

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

Thank you for picking up the issue and fixing the bug!

@dreamorosi dreamorosi merged commit d55465f into aws-powertools:main Aug 1, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working logger This item relates to the Logger Utility size/S PR between 10-29 LOC tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: logger breaks on nodejs Docker lambdas since 2.4.0
2 participants