PR #2835 — Replace e.printStackTrace() with LogEvent.logError()
develop ← Ketanop321:issue-2834-fix-printstacktrace
opened 11:22AM - 13 Feb 26 UTC
Replace 11 instances of e.printStackTrace() anti-pattern with proper LogEvent.lo… gError(e) calls in 7 source files:
- SampleTbEntryController.java: Added LogEvent import and replaced call
- SampleEntryByProjectController.java: Replaced 2 calls, removed 1 redundant
- FhirReferralServiceImpl.java: Replaced 2 calls, removed TODO comments
- PluginConfiguration.java: Replaced 1 call
- FreezerReportServiceImpl.java: Removed redundant call (LogEvent already used)
- FreezerAuditTrailController.java: Added LogEvent import and replaced 3 calls
- FreezerReportController.java: Removed redundant call (LogEvent already used)
This improves error visibility, enables log aggregation, and follows OpenELIS logging conventions. Test utilities and submodules are out of scope.
# Pull Requests Requirements
- [x] The PR title includes a brief description of the work done, including the
Issue number if applicable.
- [ ] The PR includes a video showing the changes for the work done.
- [x] The PR title follows conventional commit label standards.
- [x] The changes confirm to the OpenElis Global x3
[Styleguide and Design](https://uwdigi.atlassian.net/wiki/spaces/OG/pages/621346838/OpenELIS+Global+Style+Guide)
documentation.
- [x] The changes include tests or are validated by existing tests.
- [ ] I have read and agree to the Contributing
[Guidelines](https://openelis-global.org/community/get-involved/) of this
project.
## Summary
## Screenshots
[Add relevant screenshots here if applicable]
## Related Issue
[Add a link to the related issue or mention it here if applicable]
## Other
[Add any additional information or notes here]
Small fix across 7 backend files. Replaced 11 instances of the e.printStackTrace() anti-pattern with the project’s standard LogEvent.logError(e) logging. Improves error visibility and enables proper log aggregation.
Validation:
Build passes: mvn clean install -DskipTests
Spotless formatting applied
No logic changes — direct 1:1 replacement
Self-reviewed code
No breaking changes
@Agaba_Derrick_Junior @Moses_Mutesasira