Skip to content

Remove Exceptions stack trace from logs - #1620

Merged
MaximPlusov merged 4 commits into
integrationfrom
logs
Aug 10, 2026
Merged

Remove Exceptions stack trace from logs#1620
MaximPlusov merged 4 commits into
integrationfrom
logs

Conversation

@LonelyMidoriya

@LonelyMidoriya LonelyMidoriya commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved error logging by removing redundant exception details and stack traces from diagnostic messages.
    • Preserved existing validation, error handling, fallback behavior, and exception propagation.
    • Reduced unnecessary console output during profile loading and report generation.

@LonelyMidoriya LonelyMidoriya self-assigned this Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6c985e2f-87b7-4e3e-81ac-06870c9c9796

📥 Commits

Reviewing files that changed from the base of the PR and between 33d1f79 and 8d0e9c7.

📒 Files selected for processing (2)
  • core/src/main/java/org/verapdf/pdfa/validation/profiles/ProfileDirectoryImpl.java
  • core/src/main/java/org/verapdf/processor/reports/multithread/writer/AbstractXmlReportWriter.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • core/src/main/java/org/verapdf/processor/reports/multithread/writer/AbstractXmlReportWriter.java

📝 Walkthrough

Walkthrough

The change removes caught exception objects and stack traces from selected logs across feature extraction, processing, reporting, parsing, and profile loading. Existing control flow, fallback behavior, error registration, and exception propagation remain unchanged.

Changes

Exception diagnostics cleanup

Layer / File(s) Summary
Feature and metadata logging
core/src/main/java/org/verapdf/features/..., core/src/main/java/org/verapdf/model/..., core/src/main/java/org/verapdf/report/FeaturesNode.java, core/src/main/java/org/verapdf/ReleaseDetails.java
Feature, metadata, model, helper, and release-date logs no longer attach caught exceptions.
Processor and report logging
core/src/main/java/org/verapdf/processor/..., core/src/main/java/org/verapdf/policy/SchematronPipeline.java
Processor, plugin, XML, policy, and report-writer logs omit throwable arguments while preserving existing handling.
Exception output cleanup
core/src/main/java/org/verapdf/pdfa/validation/profiles/ProfileDirectoryImpl.java, core/src/main/java/org/verapdf/pdfa/parsers/pkcs7/PKCS7.java
Profile loading no longer prints stack traces. PKCS7 parsing logs omit the exception while the rethrown IOException retains its cause.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: maximplusov

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.39% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: removing exception stack traces from logs.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch logs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
core/src/main/java/org/verapdf/processor/reports/multithread/writer/AbstractXmlReportWriter.java (1)

74-75: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Keep a diagnostic for end-document failures.

When XML report finalization fails, the empty catch returns normally. MrrReportWriter.endDocument() then cannot report that the output may be incomplete. Replace the removed stack trace with a fixed Level.SEVERE message.

Proposed fix
} catch (XMLStreamException e) {
+	LOGGER.log(Level.SEVERE, "Can't write end document");
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@core/src/main/java/org/verapdf/processor/reports/multithread/writer/AbstractXmlReportWriter.java`
around lines 74 - 75, The XMLStreamException catch in AbstractXmlReportWriter’s
end-document finalization must retain a diagnostic. Replace the empty catch with
a Level.SEVERE log using a fixed message indicating that report output may be
incomplete, so MrrReportWriter.endDocument() surfaces the failure.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/src/main/java/org/verapdf/processor/ProcessorImpl.java`:
- Line 133: Update the affected logger.log calls in ProcessorImpl to use the
MessageFormat placeholder "{0}" in the message, ensuring the exception message
argument is recorded at FINE level. Apply this to each matching "Exception
details:" call.

---

Outside diff comments:
In
`@core/src/main/java/org/verapdf/processor/reports/multithread/writer/AbstractXmlReportWriter.java`:
- Around line 74-75: The XMLStreamException catch in AbstractXmlReportWriter’s
end-document finalization must retain a diagnostic. Replace the empty catch with
a Level.SEVERE log using a fixed message indicating that report output may be
incomplete, so MrrReportWriter.endDocument() surfaces the failure.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1233e24c-2076-473b-abee-73a258543b44

📥 Commits

Reviewing files that changed from the base of the PR and between 8b85f65 and 0dfdffb.

📒 Files selected for processing (31)
  • core/src/main/java/org/verapdf/ReleaseDetails.java
  • core/src/main/java/org/verapdf/features/FeaturesData.java
  • core/src/main/java/org/verapdf/features/FeaturesReporter.java
  • core/src/main/java/org/verapdf/features/FontFeaturesData.java
  • core/src/main/java/org/verapdf/features/ICCProfileFeaturesData.java
  • core/src/main/java/org/verapdf/features/ImageFeaturesData.java
  • core/src/main/java/org/verapdf/features/objects/FontFeaturesObject.java
  • core/src/main/java/org/verapdf/features/objects/FormXObjectFeaturesObject.java
  • core/src/main/java/org/verapdf/features/objects/ICCProfileFeaturesObject.java
  • core/src/main/java/org/verapdf/features/objects/LowLvlInfoFeaturesObject.java
  • core/src/main/java/org/verapdf/features/objects/MetadataFeaturesObject.java
  • core/src/main/java/org/verapdf/features/tools/CreateNodeHelper.java
  • core/src/main/java/org/verapdf/features/tools/ErrorsHelper.java
  • core/src/main/java/org/verapdf/model/impl/axl/AXLPDFAIdentification.java
  • core/src/main/java/org/verapdf/model/impl/axl/AXLPDFUAIdentification.java
  • core/src/main/java/org/verapdf/model/tools/xmp/validators/XPathTypeValidator.java
  • core/src/main/java/org/verapdf/pdfa/parsers/pkcs7/PKCS7.java
  • core/src/main/java/org/verapdf/pdfa/parsers/pkcs7/X509CertificateImpl.java
  • core/src/main/java/org/verapdf/pdfa/validation/profiles/ProfileDirectoryImpl.java
  • core/src/main/java/org/verapdf/pdfa/validation/validators/BaseValidator.java
  • core/src/main/java/org/verapdf/policy/SchematronPipeline.java
  • core/src/main/java/org/verapdf/processor/AbstractXmlHandler.java
  • core/src/main/java/org/verapdf/processor/FeaturesPluginsLoader.java
  • core/src/main/java/org/verapdf/processor/ProcessorImpl.java
  • core/src/main/java/org/verapdf/processor/RawResultHandler.java
  • core/src/main/java/org/verapdf/processor/reports/multithread/writer/AbstractXmlReportWriter.java
  • core/src/main/java/org/verapdf/processor/reports/multithread/writer/MrrReportWriter.java
  • core/src/main/java/org/verapdf/processor/reports/multithread/writer/RawReportWriter.java
  • core/src/main/java/org/verapdf/processor/reports/multithread/writer/ReportParserEventHandler.java
  • core/src/main/java/org/verapdf/processor/reports/multithread/writer/ReportWriter.java
  • core/src/main/java/org/verapdf/report/FeaturesNode.java
💤 Files with no reviewable changes (1)
  • core/src/main/java/org/verapdf/pdfa/validation/profiles/ProfileDirectoryImpl.java

Comment thread core/src/main/java/org/verapdf/processor/ProcessorImpl.java Outdated
@MaximPlusov
MaximPlusov merged commit bee6618 into integration Aug 10, 2026
8 of 9 checks passed
@MaximPlusov
MaximPlusov deleted the logs branch August 16, 2026 19:18
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.

2 participants