nowo-tech / http-log-bundle
Symfony bundle that intercepts HTTP requests and responses, stores them with configurable body policies, and provides a secured admin UI with filter, export, and purge.
Package info
github.com/nowo-tech/HttpLogBundle
Type:symfony-bundle
pkg:composer/nowo-tech/http-log-bundle
Fund package maintenance!
Requires
- php: >=8.2 <8.6
- doctrine/doctrine-bundle: ^2.10 || ^3.0
- doctrine/orm: ^2.15 || ^3.0
- psr/clock: ^1.0
- psr/log: ^1 || ^2 || ^3
- symfony/clock: ^7.0 || ^8.0
- symfony/config: ^7.0 || ^8.0
- symfony/dependency-injection: ^7.0 || ^8.0
- symfony/form: ^7.0 || ^8.0
- symfony/framework-bundle: ^7.0 || ^8.0
- symfony/http-foundation: ^7.0 || ^8.0
- symfony/http-kernel: ^7.0 || ^8.0
- symfony/messenger: ^7.0 || ^8.0
- symfony/routing: ^7.0 || ^8.0
- symfony/security-bundle: ^7.0 || ^8.0
- symfony/security-core: ^7.0 || ^8.0
- symfony/security-csrf: ^7.0 || ^8.0
- symfony/translation: ^7.0 || ^8.0
- symfony/twig-bundle: ^7.0 || ^8.0
- twig/twig: ^3.8
Requires (Dev)
- dg/bypass-finals: ^1.11
- friendsofphp/php-cs-fixer: ^3.0
- nowo-tech/phpstan-frankenphp: ^1.0
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^11.0
- rector/rector: ^2.0
- symfony/yaml: ^7.0 || ^8.0
README
β Found this useful? Give it a star on GitHub! It helps us maintain and improve the project.
Symfony bundle that intercepts HTTP requests and responses, stores them with configurable body policies by content type, redaction, and a secured admin UI with filter, export (CSV/JSON), and purge/retention β with optional Messenger async persistence.
π Compatible with Symfony 7.0+ and 8.x (PHP 8.2+)
This bundle is FrankenPHP worker mode friendly.
What is this?
Http Log Bundle captures each HTTP exchange on kernel terminate, classifies response bodies (html, json, soap, xml, text, binary, other), applies redaction rules, and persists to Doctrine. Operators browse logs at /admin/http-log, export filtered results, and purge by retention policy.
Features
- β Kernel subscriber capture with sampling, environment filter, and sub-request toggle
- β
Body policy by content type with
max_body_bytestruncation - β Redaction for headers, query parameters, and JSON paths
- β
Doctrine entity
HttpLogEntrywith indexes for filter queries - β Secured admin UI (filter, detail, export, purge) β REQ-UI-002
- β
CLI:
nowo:http-log:export,nowo:http-log:purge - β Messenger async: persist, export, purge handlers
- β
Ignore routes (
fnmatch) and path prefixes (admin UI excluded by default) - β
Symfony Flex recipe and FrankenPHP demo (
demo/symfony8) - β
GitHub Spec Kit baseline and 100% coverage target on
src/
Quick start
composer require nowo-tech/http-log-bundle
# config/packages/nowo_http_log.yaml nowo_http_log: capture: response_body_by_type: json: true security: access_roles: - ROLE_ADMIN
php bin/console doctrine:schema:update --force
# Configure symfony/messenger when async: true (default)
Admin UI: /admin/http-log (requires ROLE_ADMIN by default).
Development
make up
make test
make -C demo/symfony8 up
make demo-smoke
Documentation
- Installation
- Configuration
- Usage
- Contributing
- Code of Conduct
- Changelog
- Upgrading
- Release process
- Security
- Engram
- Spec-driven development
- GitHub Spec Kit
Additional documentation
Tests and coverage
| Language | Coverage (approx.) | Command |
|---|---|---|
| PHP | 100% on src/ (make test-coverage) |
make test-coverage |
make test
make test-coverage
make test-coverage-100
make release-check
Run make test-coverage after cloning to refresh the coverage badge and CI threshold (target: 100% on src/).
License
MIT β see LICENSE.
