sblum/exception-enricher
A Laravel/PHP package that enriches exceptions with useful context, such as request, user, and application data, making logs and error reports more actionable. Add custom enrichment logic to improve debugging and observability.
WARNING and above means the failing request payload is already in the log when checkout, auth, or integration calls break — support and on-call can reconstruct the failure without a reproduction session or a customer call. This is a direct input to whether we invest in "reproducible-by-default" production debuggability or keep paying for it in escalation time.INFO/DEBUG, secrets masked by field name (password, token, jwt, secret, authorization, api_key, credential) across form, JSON (including BOM), and urlencoded bodies, nested and inside lists. That is a decision we can adopt as our default logging standard rather than writing one, but it also sets the ceiling of what our policy covers — field names outside that list (SSN, card number, CVV, IBAN, DOB, medical record IDs) are not masked. This needs a privacy/legal sign-off decision, not an engineering one.INFO/DEBUG and truncating at 2048 characters bounds both log volume and per-record size — a direct lever on storage, SIEM ingest, and egress cost. This is one of the few observability changes that improves debuggability and reduces spend, which makes it unusually easy to justify.symfony/yaml dependency. Adopting this pulls the PHP-upgrade conversation forward; if we are on PHP 8.1/8.2 or Symfony 5.4, the real decision is the upgrade, not the package.Consider adopting when:
INFO/DEBUG without losing the ability to see who and what URI triggered a request.Look elsewhere or validate first when:
services.php, Symfony 8 : void signature), not a Laravel service provider. If our codebase is Laravel, confirm a maintained integration exists or expect adapter work; a Laravel-native logging package may be the better fit. This is the first thing to verify.Evidence gaps to close before an ADR: this assessment is based on a single release's notes. License, maintainer depth and bus factor, test coverage of the masking paths, existing adoption, and issue responsiveness are all unknown. Pull the repo, read the masking tests, and check the changelog history before committing.
To executives: One paragraph — this is a small, low-cost logging component that makes production failures diagnosable from the log alone, cuts log storage and SIEM ingest by dropping request bodies from routine INFO/DEBUG traffic, and ships with credential masking and hard size caps on by default so we are not writing customer secrets into our log platform. It also keeps us on currently supported PHP and Symfony versions, which reduces security-patch risk. The ask is an engineering day plus a privacy review, not a budget line.
To engineering: Drop-in request-context capture for Monolog. Bodies at WARNING+ only, capped at 2048 characters with an explicit truncation marker so you know you're missing data rather than silently guessing. Masking covers form, JSON (BOM-safe), and urlencoded bodies, nested and in lists, matching on field names and substrings of field names. Unmaskable bodies are dropped rather than logged raw. Symfony 8 loading bug fixed, symfony/yaml no longer a hidden dependency, PHP 8.3+.
To security, legal, and compliance: The defaults are conservative and fail closed: no bodies below WARNING, secrets replaced with *** as whole values (including inside objects and arrays), and anything we cannot confidently mask is omitted. Two things need your explicit sign-off: (1) masking is name-based, so our field-naming conventions are the control — we should confirm the list covers our regulated fields or extend it; (2) WARNING-level records will contain customer-submitted data, so retention and access controls on the log store become in-scope for the privacy review.
Before we sign off: confirm the Laravel-vs-Symfony integration story, review the masking test suite, run a red-team pass with our own field names, and confirm log retention policy covers WARNING-level payloads.
How can I help you explore Laravel packages today?