Skip to content

feat(scan): structured logging for scans (URL, duration, violations, error class) - #130

Merged
ieliofficial merged 2 commits into
mainfrom
feat/structured-scan-logging
Sep 30, 2026
Merged

ieliofficial merged 2 commits into
mainfrom
feat/structured-scan-logging

Conversation

@DevOlabode

@DevOlabode DevOlabode commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Closes #126.

ScanRunner.run() now emits one JSON line per scan ("event":"scan"): console.log on success, console.error on failure.

  • ok: url, durationMs, violations (count per bucket), totalViolations
  • error: url, durationMs, errorClass, error. Covers SSRF rejection, browser launch failure (previously unlogged), and page/axe errors.

Return/throw behaviour is unchanged. Adds a test in backend/tests/scanRunner.test.js; all 130 backend tests pass.

@ieliofficial ieliofficial left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, approving. The full URL in the log was already there before this PR, scanController logs it on every scan request, so I'll open a separate issue to strip query strings in both places.

@ieliofficial
ieliofficial merged commit 909e126 into main Sep 30, 2026
2 checks passed
@ieliofficial
ieliofficial deleted the feat/structured-scan-logging branch September 30, 2026 12:33
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 structured logging for scans (URL, duration, violation count, error class)

2 participants