feat(payments-api): control Nest log verbosity with LOG_LEVEL - #21086
Open
david1alvarez wants to merge 1 commit into
Open
feat(payments-api): control Nest log verbosity with LOG_LEVEL#21086david1alvarez wants to merge 1 commit into
david1alvarez wants to merge 1 commit into
Conversation
Because: - payments-api logged every level in every environment and ignored the LOG_LEVEL convention the other services follow. This commit: - Maps LOG_LEVEL onto Nest's logger, defaulting to `log`. Closes PAY-3816
Contributor
There was a problem hiding this comment.
Pull request overview
Adds environment-controlled NestJS logging to Payments API.
Changes:
- Maps
LOG_LEVELvalues to Nest log levels with aninfoalias and safe fallback. - Enables debug logging for local development.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
apps/payments/api/src/main.ts |
Configures Nest logging from LOG_LEVEL. |
apps/payments/api/.env |
Sets the local log level to debug. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
StaberindeZA
left a comment
Contributor
There was a problem hiding this comment.
r+wc.
Please add an entry to RootConfig for Log Level. Even though the env var gets used before config is initialized, at least this way there will still be an error if an invalid Log Level is provided.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because
environment. There is no way to quiet it without a code change.
LOG_LEVELand defaults toinfo.payments-api was the one service ignoring it.
This pull request
loggerarray toNestFactory.create, so Nest'sown severity ordering filters output.
infoalongside Nest's six level names.logwhenLOG_LEVELis unset or unrecognized.LOG_LEVEL=debuginapps/payments/api/.envfor local dev paritywith payments-next.
Issue that this pull request solves
Closes: PAY-3816
Checklist
Put an
xin the boxes that applyHow to review (Optional)
Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
infomaps to Nest'slogbecauseLOG_LEVEL=infois the FxA-wide default.Nest has no
infolevel and treats an unrecognized level as a floor nothingclears, so passing the value straight through would silence the service.
The
?? 'log'fallback covers the same failure for a typo.noUncheckedIndexedAccessis off, so a bad value compiles clean and yields
logger: [undefined], whichemits nothing.
No pre-merge review skill was run — 14 lines of bootstrap config with no
payment, auth, or crypto logic.