-
Notifications
You must be signed in to change notification settings - Fork 4k
fix(application-generic): logging levels #8111
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
fix(application-generic): logging levels #8111
Conversation
✅ Deploy Preview for dashboard-v2-novu-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
||
return { | ||
exclude: [{ path: '*/health-check', method: RequestMethod.GET }], | ||
assignResponse: true, |
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.
customProps is not needed because of this new flag that was introduced in pino 4.2 version.
customProps: (req: any, res: any) => ({
user: {
userId: req?.user?._id || null,
environmentId: req?.user?.environmentId || null,
organizationId: req?.user?.organizationId || null,
},
authScheme: req?.authScheme,
rateLimitPolicy: res?.rateLimitPolicy,
}),
pinoHttp: { | ||
customLevels: loggingLevelSet, | ||
level: values.level, | ||
useOnlyCustomLevels: true, |
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.
in the end i kept the custom levels, this flag is making sure that they are not overridden by the built-in levels in pino
trace: 10, | ||
debug: 20, | ||
info: 30, | ||
verbose: 20, | ||
debug: 10, | ||
warn: 40, | ||
error: 50, | ||
fatal: 60, | ||
none: 70, |
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.
alignment with the pino logger levels with additional 'none' in case we want to silence the logs.
if (process.env.LOGGING_LEVEL || process.env.LOG_LEVEL) { | ||
logLevel = process.env.LOGGING_LEVEL || process.env.LOG_LEVEL; |
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.
backward compatibility for the old LOGGING_LEVEL environment variable.
@@ -159,7 +159,7 @@ jobs: | |||
- name: Run Lint, Build, Test | |||
uses: mansagroup/nrwl-nx-action@v3 | |||
env: | |||
LOGGING_LEVEL: 'info' | |||
LOG_LEVEL: '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.
@merrcury do we need to makes some updates on TF deployment aswell?
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.
No, We need to make this change just in secret Manager
redact: { | ||
paths: redactFields, | ||
censor: customRedaction, |
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.
What this one was doing originally?
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.
nvm, I see it's a blank function
What changed? Why was the change needed?
Screenshots
Expand for optional sections
Related enterprise PR
Special notes for your reviewer