Skip to content

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

Merged
dreamorosi merged 4 commits into
aws-powertools:mainfrom
daschaa:2851_invalid_timezone_env_var
Aug 1, 2024
Merged

fix(logger): invalid time zone environment variables leads to error#2865
dreamorosi merged 4 commits into
aws-powertools:mainfrom
daschaa:2851_invalid_timezone_env_var

Conversation

@daschaa

@daschaa daschaa commented Jul 31, 2024

Copy link
Copy Markdown
Contributor

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 a review from a team July 31, 2024 10:37
@daschaa
daschaa requested a review from a team as a code owner July 31, 2024 10:37

@dreamorosi dreamorosi left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread packages/logger/src/formatter/LogFormatter.ts Outdated
@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
@sonarqubecloud

sonarqubecloud Bot commented Aug 1, 2024

Copy link
Copy Markdown

@dreamorosi dreamorosi left a comment

Copy link
Copy Markdown
Contributor

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
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