Skip to content

Comments

#1336 : poc-logger-suppress#1566

Open
pratt4 wants to merge 1 commit intogoogle:masterfrom
pratt4:1336-flag-suppress-logs
Open

#1336 : poc-logger-suppress#1566
pratt4 wants to merge 1 commit intogoogle:masterfrom
pratt4:1336-flag-suppress-logs

Conversation

@pratt4
Copy link
Collaborator

@pratt4 pratt4 commented Feb 6, 2026

This PR adds a new flag --quietMode (default false) to reduce noisy production logs without changing default behavior.
When --quietMode=true, logging for noisy packages is set to WARN at runtime and HAPI request-summary logging is disabled, so URL/per-request INFO chatter is suppressed while WARN/ERROR remains visible.
It is applied in both launcher and worker paths (FhirEtl, ParquetMerger, FetchSearchPageFn setup, and controller pipeline paths), so it works for distributed Beam execution too.
I also propagated quiet mode to incremental merger options from the controller.

About String.format changes: correctness does not depend on this, but it is useful in hot INFO paths.
String.format(...) builds the string even when INFO is disabled; SLF4J placeholder style ("{}") defers formatting unless that log level is enabled.
So in quiet mode it avoids unnecessary formatting overhead.
If you want minimal diff, we can keep this only for high-frequency INFO logs and revert the rest.

I validated with targeted tests: FetchUtilTest, FetchResourcesTest, and FhirSearchUtilTest passed.

closes #1336

will extend this other modules also.. if the way of suppressing is approved

thanks

@pratt4 pratt4 requested a review from bashir2 February 6, 2026 19:19
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 26.82927% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.52%. Comparing base (8434457) to head (ae2929e).

Files with missing lines Patch % Lines
...com/google/fhir/analytics/LoggingConfigurator.java 14.28% 17 Missing and 1 partial ⚠️
...c/main/java/com/google/fhir/analytics/FhirEtl.java 0.00% 5 Missing ⚠️
...java/com/google/fhir/analytics/FetchResources.java 50.00% 2 Missing ⚠️
.../java/com/google/fhir/analytics/ParquetMerger.java 0.00% 2 Missing ⚠️
...ava/com/google/fhir/analytics/PipelineManager.java 50.00% 2 Missing ⚠️
...main/java/com/google/fhir/analytics/FetchUtil.java 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1566      +/-   ##
============================================
- Coverage     46.61%   46.52%   -0.10%     
- Complexity      678      681       +3     
============================================
  Files            90       91       +1     
  Lines          5886     5915      +29     
  Branches        834      836       +2     
============================================
+ Hits           2744     2752       +8     
- Misses         2827     2848      +21     
  Partials        315      315              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an option to suppress pipeline logs.

2 participants