The bundle can emit structured logs for every intercepted Playwright request. Logging is disabled by default to keep CI output quiet.
- Bundle config (e.g.
config/packages/test/playwright.yaml):
playwright:
debug_logging: true- Environment override:
PLAYWRIGHT_VERBOSE=1 vendor/bin/phpunit …
The environment variable always wins over configuration.
- Logs are sent to the
monolog.logger.playwrightchannel when available, otherwise the defaultloggerservice. - When debug logging is enabled:
info: emitted after each intercepted request (includes method, URI, status, duration).debug: emitted for routing decisions (asset hits/misses, continued external requests) and navigation calls.
- Errors (e.g. kernel exceptions) are logged regardless of the debug flag.
# config/packages/test/monolog.yaml
monolog:
channels: ['playwright']
handlers:
playwright:
type: stream
path: '%kernel.logs_dir%/playwright.log'
channels: ['playwright']
level: debug[info] Fulfilled intercepted request {"method":"GET","uri":"http://localhost/login","status_code":200,"duration_ms":12}
[debug] AssetServer fulfilled request {"url":"http://localhost/assets/app.css","method":"GET"}
Use these logs to trace failing browser interactions without re-running tests locally.