-
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
feat: make slogger logging optional #377
Conversation
WalkthroughThis pull request introduces a new configuration variable Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/api/src/config/logger.config.ts (1)
21-22
: Consider normalizing environment variable checks.Currently, the code directly checks for the string
'true'
. If the environment variable has different casing (e.g.,'TRUE'
) or whitespace, this conditional might fail. Consider using.toLowerCase().trim() === 'true'
for a more robust check:- const enableSlogger = configService.get<string>('ENABLE_SLOGERR') || 'false'; + const enableSloggerRaw = configService.get<string>('ENABLE_SLOGERR') || 'false'; + const enableSlogger = enableSloggerRaw.toLowerCase().trim() === 'true';
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/api/.env.example
(1 hunks)apps/api/src/config/logger.config.ts
(2 hunks)
🔇 Additional comments (2)
apps/api/src/config/logger.config.ts (1)
100-100
: Good use of optional transport inclusion.Conditionally enabling the
slogerrTransport
based on an environment variable is a clean approach, keeping the default behavior disabled while providing an easy toggle.apps/api/.env.example (1)
25-25
: Environment variable is well-documented and consistent with code.The
ENABLE_SLOGERR
variable defaulting tofalse
matches the implementation, ensuring that Slogerr logging remains off by default unless explicitly enabled.
API PR Checklist
Pre-requisites
.env.example
file with the required values as applicable.PR Details
PR details have been updated as per the given format (see below)
feat: add admin login endpoint
)Additional Information
ready for review
should be added if the PR is ready to be reviewed)Note: Reviewer should ensure that the checklist and description have been populated and followed correctly, and the PR should be merged only after resolving all conversations and verifying that CI checks pass.
Description:
Add a optional flag for slogger logging based on the env variable set log is sent to slogger , by default it set as false
Related changes:
Screenshots:
N/A
Query request and response:
N/A
Documentation changes:
N/A
Test suite/unit testing output:
N/A
Pending actions:
N/A
Additional notes:
N/A
Summary by CodeRabbit
ENABLE_SLOGERR
to control Slogger error reporting