Skip to content

improv(logger): switch key order for better readability #3560

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 1 commit into from
Feb 5, 2025

Conversation

dreamorosi
Copy link
Contributor

Summary

Changes

Please provide a summary of what's being changed

This PR updates the order of the keys in the default log formatter of Logger so that the most important information about the log entry are surfaced first. Specifically, we are now prioritizing the placement of the level, message, timestamp, and service rather than lower cardinality data such as cold_start, function_arn and others.

Since we are dealing with JSON-structured logs that are expected to be queried once parsed, changing the order should not constitute a breaking change.

Please add the issue number below, if no issue is present the PR might get blocked and not be reviewed

Issue number: closes #3091


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.

@dreamorosi dreamorosi self-assigned this Feb 5, 2025
@dreamorosi dreamorosi requested a review from a team February 5, 2025 17:03
@dreamorosi dreamorosi requested a review from a team as a code owner February 5, 2025 17:03
@boring-cyborg boring-cyborg bot added documentation Improvements or additions to documentation logger This item relates to the Logger Utility tests PRs that add or change tests labels Feb 5, 2025
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Feb 5, 2025
Copy link

sonarqubecloud bot commented Feb 5, 2025

@github-actions github-actions bot added the enhancement PRs that introduce minor changes, usually to existing features label Feb 5, 2025
@dreamorosi dreamorosi merged commit e3f935c into main Feb 5, 2025
48 checks passed
@dreamorosi dreamorosi deleted the refactor/logger_key_order branch February 5, 2025 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement PRs that introduce minor changes, usually to existing features logger This item relates to the Logger Utility size/L PRs between 100-499 LOC tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Change powertools lambda context capture log key order
2 participants