-
Notifications
You must be signed in to change notification settings - Fork 7
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
BREAKING CHANGE: add support to log tenantId #17
Conversation
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "logger-safe-security", | |||
"version": "1.2.1", | |||
"version": "1.2.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this change. We have auto-release configured.
src/index.ts
Outdated
info.tenantId = valueFromMethod<string>("tenantId"); | ||
} | ||
} catch (error) { | ||
console.error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the error log.
src/index.ts
Outdated
/* A custom format that is used to include tenantId. */ | ||
const formatTenantId = (parameters: ParameterConfig | undefined) => { | ||
return winston.format(info => { | ||
info.tenantId = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this as well. If we get tenantId from the context then use it, else make no changes.
@@ -18,16 +27,44 @@ const formatError = winston.format(info => { | |||
return info; | |||
}); | |||
|
|||
/* A custom format that is used to include tenantId. */ | |||
const formatTenantId = (parameters: ParameterConfig | undefined) => { | |||
return winston.format(info => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the dependency on the tenantId and make this generic?
From the parameters config, get the keys, check if the key is present in the store, if yes, add it to info
else skip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the PR title with breaking changes.
To test this:- New
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
# [2.0.0](v1.2.1...v2.0.0) (2022-12-13) ### Features * add support to log additional attributes by default ([#17](#17)) ([1d022c7](1d022c7)) ### BREAKING CHANGES * add arbitrary parameters to be part of every log line by default
🎉 This PR is included in version 2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Includes handling of missing contexts.
Evidences:-
MT with context: https://app.flonnect.com/view/video/jibin.m/63919070f31aaa756ef77d3d
MT without context: https://app.flonnect.com/view/video/jibin.m/63919100f31aaa756ef77d5f
ST: https://app.flonnect.com/view/video/jibin.m/6391944cf31aaa756ef77df4