Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Exception Enricher Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Initial assessment based on v2.2.0. The package is a request-logging/observability add-on that captures request context and POST bodies into log records, with Monolog/Symfony integration. For a Laravel/PHP estate it fits as a low-coupling logging processor/channel rather than an application framework dependency. v2.2.0 materially improves the security posture by masking secret-like fields and reducing body capture at lower log levels, but it also changes the observability contract.

  • Architecture fit: Good for Laravel monoliths, APIs, and worker services that already use Monolog channels. It should sit in the logging pipeline before external shipping/aggregation. The package does not appear to own request lifecycle or persistence, so architectural coupling is low.
  • Integration feasibility: Composer-installable; requires PHP 8.3+ and supports Symfony 6.4, 7.4, and 8.1 components. Laravel 10/11/12 on PHP 8.3 should be feasible if Monolog/Symfony component constraints resolve. The services.php change removing a hidden symfony/yaml dependency is a positive footprint reduction. Confirm the Laravel service-provider/auto-discovery path, since the release notes are framed around a Symfony bundle.
  • Technical risk: The most significant behavioral change is POST data capture only at WARNING and above. Teams relying on INFO/DEBUG request bodies for troubleshooting, replay, or audit will lose that data. Secret masking is high-value but heuristic: field-name substring matching can over-mask benign fields (e.g., tokenizer) and under-mask unrecognized secret names (e.g., passwd, pwd, custom credential headers). Bodies that cannot be masked are omitted entirely, which is fail-closed for security but can silently remove useful XML/text logs. The 2048-character truncation limits payload visibility and may cut diagnostic context. PHP 8.3+ is a runtime gate that can block adoption. Masking performance on large bodies depends on whether truncation occurs before scanning; verify.
  • Key questions:
    • Which Laravel and PHP versions are in our fleet, and can we standardize on PHP 8.3+?
    • Do any teams or alerts depend on POST bodies at INFO/DEBUG? If so, can they move to WARNING or a separate audit channel?
    • Are 2048 characters sufficient for our typical payloads, and is the truncation marker parseable by our log pipeline?
    • Are secret field-name patterns configurable? Do they cover our naming conventions (camelCase, pwd, client_secret, authorization headers, cookies)?
    • How are multipart/form-data, file uploads, non-UTF8 bodies, and query strings handled?
    • Does masking run before or after truncation, and what is the CPU overhead at expected WARNING volume?
    • Is there a Laravel-specific config/service provider, or is this consumed strictly as a Symfony bundle via Monolog?
    • What is the upgrade path from the prior package version, and are there config or constructor signature changes?

Integration Approach

  • Stack fit: Target Laravel 10/11/12 on PHP 8.3+, using the package as a Monolog processor or dedicated logging channel. Symfony 6.4/7.4 compatibility aligns with current Laravel Symfony component ranges; Symfony 8.1 support is forward-looking. Verify Composer constraints against the application's monolog/monolog and symfony/* versions.
  • Migration path: No data migration is required. Upgrade PHP to 8.3+ first if needed, then update the package via Composer. Review configuration for new masking/truncation options. If the application depends on INFO/DEBUG POST bodies, either raise those events to WARNING or accept loss and adjust runbooks. For critical XML/text payloads that may contain secret words, provide a separate redacted audit path rather than relying on this package's omission behavior.
  • Compatibility: Confirm Laravel version support explicitly. Laravel 10 can run on PHP 8.3; Laravel 11/12 are also viable. Check Octane/long-running worker behavior for state leakage. If custom Monolog processors exist, ensure this package's masking runs before any external log shipping. Validate that services.php and Symfony 8 fixes do not affect Laravel auto-discovery.
  • Sequencing:
    1. Inventory PHP/Laravel versions and all log consumers (SIEM, dashboards, alerts, support tooling).
    2. Security review of masking rules, omission behavior, and remaining PII fields (IP, session, user, URI, user agent).
    3. Upgrade PHP runtime if required; pin package version in Composer.
    4. Install in development with representative payloads: JSON with BOM, form-urlencoded, nested objects/lists, XML/text with secret words, multipart, oversized bodies.
    5. Validate staging output against SIEM parsers and alerting; update dashboards for missing body fields and truncation markers.
    6. Canary production; monitor log volume, error rates, and any missing-body support tickets.
    7. Full rollout and update operational runbooks.

Operational Impact

  • Maintenance: Low ongoing code maintenance; mainly Composer update cadence and runtime lifecycle alignment. PHP 8.3+ becomes a platform constraint. Symfony 6.4/7.4/8.1 support and removal of the hidden YAML dependency reduce future upgrade friction. Track upstream releases and issue #15 for masking edge cases.
  • Support: Support teams will need a clear runbook for “why is the request body missing?” Answers include: log level below WARNING, unmaskable body omitted, or truncation. Secret masking should reduce incident severity for leaked credentials, but false positives can make debugging harder. Provide examples of masked, omitted, and truncated records.
  • Scaling: Log volume should decrease at INFO/DEBUG because bodies are no longer captured. WARNING+ records still carry up to 2048 characters, so high-warning-volume services should account for per-event storage and masking CPU. Omission of unmaskable bodies reduces storage but may increase mean time to diagnose XML/text issues. Test under production-like load, especially if large bodies are scanned before truncation.
  • Failure modes:
    • Secret masking false negative → credential leakage; mitigate with security tests and configurable patterns if available.
    • Over-masking benign fields → reduced debuggability.
    • Unmaskable XML/text bodies omitted → missing logs exactly when secrets are present; provide fallback audit channel for critical flows.
    • Truncation at 2048 chars → incomplete payload; full length is noted but content is lost.
    • JSON decode/encode failure → body omitted; monitor for unexpected gaps.
    • PHP/Symfony version mismatch → boot or autoload failures; enforce via Composer constraints.
    • Log-level dependency → INFO/DEBUG POST data disappears; alerting must not assume body presence.
    • Multipart/file-upload handling unclear → potential leakage or omission; validate before rollout.
  • Ramp-up: Laravel developers should ramp up quickly because this is a logging configuration change, not an application API change. Security/legal review is the larger effort because IP, session, user, URI, and user agent are still logged at INFO/DEBUG. SRE/observability teams need to update parsers and dashboards for truncation markers and absent body fields. Estimate roughly half a day for developer integration, 1–2 days for security review, and staging validation before canary rollout.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus