Skip to content

fix(#10357): prevent DEBUG logs from appearing in production#10583

Merged
sugat009 merged 15 commits intomasterfrom
10357-fix-debug-logs-v2
Mar 30, 2026
Merged

fix(#10357): prevent DEBUG logs from appearing in production#10583
sugat009 merged 15 commits intomasterfrom
10357-fix-debug-logs-v2

Conversation

@sugat009
Copy link
Copy Markdown
Member

@sugat009 sugat009 commented Jan 20, 2026

Summary

Fixes #10357 - DEBUG logs were appearing in production despite NODE_ENV=production.

Changes:

  • Default LOG_LEVEL to 'info' when not explicitly set in application code
  • Add LOG_LEVEL: 'debug' to CI workflow env (instead of repeating in each npm script)
  • Fix sentinel helm template to use .Values.sentinel.log_level instead of .Values.api.log_level
  • Add sentinel.log_level and api.log_level defaults to base.yaml

Based on

This PR is based on the work by @AmirSaudagar55 in #10376. Additional fixes were made to:

  • Resolve merge conflicts with master
  • Fix helm template values path for sentinel
  • Refactor LOG_LEVEL=debug from npm scripts to CI workflow env

Code review checklist

  • UI/UX backwards compatible: Test it works for the new design (enabled by default). And test it works in the old design, enable can_view_old_navigation permission to see the old design. Test it has appropriate design for RTL languages.
  • Readable: Concise, well named, follows the style guide, documented if necessary.
  • Documented: Configuration and user documentation on cht-docs
  • Tested: Unit and/or e2e where appropriate
  • Internationalised: All user facing text
  • Backwards compatible: Works with existing data and configuration or includes a migration. Any breaking changes documented in the release notes.

Compose URLs

If Build CI hasn't passed, these may 404:

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

@sugat009 sugat009 marked this pull request as ready for review February 6, 2026 11:13
@sugat009 sugat009 self-assigned this Feb 9, 2026
@sugat009 sugat009 added the Type: Bug Fix something that isn't working as intended label Feb 9, 2026
@github-actions
Copy link
Copy Markdown

This PR is now marked "stale" after 30 days without activity. It will be closed automatically in 10 days unless you add a comment, push new changes or remove the "stale" label.

@github-actions github-actions bot added the Stale label Mar 12, 2026
@sugat009 sugat009 removed the Stale label Mar 12, 2026
@sugat009 sugat009 requested a review from jkuester March 23, 2026 10:53
@sugat009
Copy link
Copy Markdown
Member Author

@jkuester Would appreciate a review on this. Thanks!

Copy link
Copy Markdown
Contributor

@jkuester jkuester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for keeping this going! Just a couple minor things and this should be good to go!


Can we also get a docs PR to update the log level documentation?

@jkuester
Copy link
Copy Markdown
Contributor

Another thing that is worth considering is if we should update the dev-api and dev-sentiel commands to set LOG_LEVEL=DEBUG? I think we want the debug logs when running in the development environment...

@sugat009
Copy link
Copy Markdown
Member Author

Thanks for keeping this going! Just a couple minor things and this should be good to go!

Can we also get a docs PR to update the log level documentation?

Actually, there is already a PR for this. medic/cht-docs#2030

Copy link
Copy Markdown
Contributor

@mrjones-plip mrjones-plip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotta question about the extra compose file!

Copy link
Copy Markdown
Contributor

@jkuester jkuester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple minor suggestions around not reading the host LOG_LEVEL envar even for our test/development scripts. I am fine if you want to keep them as-is, but I just think it will be less complex to just hardcode the value (and might save some confusion in the future).

@sugat009 sugat009 merged commit 3f71ecd into master Mar 30, 2026
90 of 92 checks passed
@sugat009 sugat009 deleted the 10357-fix-debug-logs-v2 branch March 30, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug Fix something that isn't working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

debug level messages printed on production instances

4 participants