Skip to content

Enrich Monolog logs with security and request context - #640

Merged
phavekes merged 4 commits into
mainfrom
feature/security-context-log-processor
Oct 7, 2026
Merged

phavekes merged 4 commits into
mainfrom
feature/security-context-log-processor

Conversation

@phavekes

@phavekes phavekes commented Oct 6, 2026

Copy link
Copy Markdown
Member

Summary

Adds SecurityContextProcessor to automatically enrich Monolog log records with request context (http_method, path, route, client_ip) and the authenticated user identifier.

Changes

  • Created Surfnet\StepupMiddleware\ApiBundle\Logger\SecurityContextProcessor tagged with #[AutoconfigureTag('monolog.processor')].
  • Added unit tests in Surfnet\StepupMiddleware\ApiBundle\Tests\Logger\SecurityContextProcessorTest.

Verification

  • Validated coding standards with ci/qa/docheader, ci/qa/phpcs, and ci/qa/phplint.
  • Ran static analysis on new classes with phpstan (0 errors).

@phavekes
phavekes requested a review from kayjoosten October 6, 2026 08:47
- Add SecurityContextProcessor to enrich Monolog records with HTTP method, path, route, client IP, and authenticated user identifier.
- Add unit tests in SecurityContextProcessorTest.
@phavekes
phavekes force-pushed the feature/security-context-log-processor branch from 143ae60 to 7d609fd Compare October 6, 2026 12:04
Comment thread src/Surfnet/StepupMiddleware/ApiBundle/Logger/SecurityContextProcessor.php Outdated
@phavekes
phavekes requested a review from kayjoosten October 7, 2026 08:24
@phavekes
phavekes merged commit b53ed92 into main Oct 7, 2026
3 checks passed
@phavekes
phavekes deleted the feature/security-context-log-processor branch October 7, 2026 09:13
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