-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(logger): introduce log key reordering functionality (#2736)
- Loading branch information
1 parent
ad323ae
commit 9677258
Showing
9 changed files
with
370 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Logger } from '@aws-lambda-powertools/logger'; | ||
|
||
const logger = new Logger({ | ||
serviceName: 'serverlessAirline', | ||
logRecordOrder: ['timestamp', 'additionalKey'], | ||
}); | ||
|
||
export const handler = async (): Promise<void> => { | ||
logger.info('Hello, World!', { | ||
additionalKey: 'additionalValue', | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"timestamp": "2024-09-03T02:59:06.603Z", | ||
"additionalKey": "additionalValue", | ||
"level": "INFO", | ||
"message": "Hello, World!", | ||
"sampling_rate": 0, | ||
"service": "serverlessAirline", | ||
"xray_trace_id": "1-66d67b7a-79bc7b2346b32af01b437cf8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.