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

feat!: replace tslog by awspowertools logging #3037

Merged
merged 8 commits into from
Mar 22, 2023
Merged

Conversation

npalm
Copy link
Collaborator

@npalm npalm commented Mar 8, 2023

The module is using TSLog now for a sometime. But after breaking changes we are not able to update TSLog anymore. In the meantime, AWS have released AWS Powertools for Lambda, including logging capabilities. Since this solution is AWS native, we are replacing the outdated TSLog by AWS Powertools logging.

Breaking change

In this PR we replace TSLog by AWS Powertools logs with a minimal impact on code changes. The change can have be breaking in the following cases:

  • Processing the logging, we only will support JSON formatted log
  • Depending on the removed setting LOG_TYPE
  • Depending on the LOG_LEVEL silly, fatal or trace

Log messages

All log messages are JSON formatted and contain besides the message scope information like: function-name, environment, module. By enabling DEBUG log level the event received by the Lambda will be logged.

@npalm npalm marked this pull request as draft March 8, 2023 10:58
@npalm npalm changed the title feat: replace tslog by awspowertools logging feat!: replace tslog by awspowertools logging Mar 8, 2023
@npalm npalm force-pushed the feat/awspowertools-logging branch from 2e45a92 to f539cc7 Compare March 15, 2023 08:12
@npalm npalm marked this pull request as ready for review March 15, 2023 13:23
@GuptaNavdeep1983 GuptaNavdeep1983 self-requested a review March 16, 2023 15:07
npalm added 2 commits March 20, 2023 08:39
replace logger by awslogger

fix local.ts

refactor and redact token in log
@npalm npalm requested a review from GuptaNavdeep1983 March 20, 2023 08:34
@GuptaNavdeep1983
Copy link
Contributor

Tested the changes in this PR using default example and the logging changes are reflected in cloud watch log group.

@GuptaNavdeep1983 GuptaNavdeep1983 self-requested a review March 21, 2023 13:18
@npalm npalm merged commit 4c3ee20 into main Mar 22, 2023
@npalm npalm deleted the feat/awspowertools-logging branch March 22, 2023 10:07
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.

3 participants