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

Laravel Log Enhancer Laravel Package

freshbitsweb/laravel-log-enhancer

Laravel Log Enhancer automatically enriches every log entry with useful request context—logged-in user ID, request URL, IP address, input and session data—so you can debug production issues faster. Quick to install and configure, no code changes needed.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • A thin, single-purpose package that decorates Laravel's existing logging pipeline rather than replacing it. It hooks into Monolog (via a processor/tap) and/or the Log facade to append request-scoped context — URL, method, authenticated user, session/correlation identifiers, and optionally request input.
  • Zero infrastructure footprint: no migrations, no tables, no queues, no routes, no facade you must call throughout the codebase. That means it can be adopted or removed without touching application code — the key architectural property for a TPM evaluating it.
  • Complements, rather than competes with, structured logging and APM (Sentry, Datadog, Fluentd/CloudWatch). It improves the human-readable/contextual quality of application logs; it is not an observability platform.

Integration feasibility

  • Install is a composer require, a config publish, and an environment toggle. Realistic effort: a few hours for a proof of concept, one to two days including redaction policy, validation, and rollout documentation.
  • The main integration friction is ordering and coexistence: verify how it registers relative to existing Monolog tap entries and custom processors in config/logging.php, and confirm behavior on stack channels and non-default formatters (single-line vs. JSON).
  • Low coupling to business logic, but nontrivial coupling to the logging configuration — a config change in config/logging.php can silently disable the enhancer. Needs an owner and a smoke test.

Technical risk

  • PII/secret exposure is the dominant risk. If request input or headers are captured, tokens, passwords, cookies, and customer data land in log storage with a different retention and access model than the database. This is the item that requires explicit sign-off, not a default.
  • Log volume and cost. Enriched payloads are materially larger per line, and request-scoped context multiplies the number of lines affected. On high-RPS endpoints this is a direct ingestion-cost line item.
  • Runtime context correctness. Under long-lived workers (Octane, Swoole), static request context can bleed between requests if not reset — a correctness and data-leak failure mode that unit tests rarely catch.
  • Log injection / formatting breakage. Untrusted input written into log lines can break parsers or forge log entries unless properly escaped.
  • Version currency. "Laravel 5.6+" is a broad claim; confirm support for current Laravel (11/12) and Monolog 3, since the underlying Monolog context APIs changed. A 2026-03-21 release date is a positive signal of recent activity, but 345 stars indicates a small maintainer base — treat it as a single-maintainer dependency.

Key questions

  1. What exactly is captured by default — headers, request body, query string, session ID, user ID? Is capture opt-in or opt-out?
  2. Is there a redaction/allowlist mechanism, and does it apply recursively to nested arrays and JSON bodies?
  3. Does it reset context correctly under Octane/queued jobs/scheduled commands, or does it assume a classic per-request lifecycle?
  4. What is the measured per-request overhead, and how does payload size behave on large form/file-upload requests?
  5. Does it coexist cleanly with our existing Monolog taps, Sentry/Bugsnag handlers, and JSON formatters?
  6. Who maintains it, what is the release cadence, and is the license/contribution model acceptable for a dependency that touches production logs?

Integration Approach

Stack fit

  • Best fit: Laravel applications already on standard Monolog channels (single/daily/stack) that ship logs to a centralized aggregator. The value is highest in pre-production and staging, where richer context shortens debugging cycles.
  • Weaker fit: services with strict data-residency or PII-scrubbing obligations, or teams already standardized on structured JSON logging with explicit field schemas — in those cases the enhancer's implicit schema may conflict with the established one.

Migration path

  1. Install and publish config in one non-critical service; leave the enhancer disabled by default at the package level.
  2. Define the redaction/allowlist policy before enabling input capture — treat this as a security review artifact, not a config detail.
  3. Enable in local/staging first, with input capture on, to validate usefulness.
  4. Enable in production with input capture off or narrowly scoped, then widen based on measured value versus cost.
  5. Encode the resulting config into the shared service template so new services inherit the policy rather than reinventing it.

Compatibility

  • Validate the version matrix explicitly: Laravel major, PHP version, Monolog major, and presence of Octane/Swoole.
  • Audit config/logging.php for pre-existing tap arrays and custom processors — confirm additive behavior, not override.
  • Confirm behavior against every formatter in use; JSON channels must remain machine-parseable after enrichment.

Sequencing

  • Phase 1 (week 1): spike in one service, capture before/after log samples, measure payload size and latency delta.
  • Phase 2 (week 2): security review of captured fields and redaction rules; write the field dictionary.
  • Phase 3 (weeks 3–4): production rollout to a small service set with input capture constrained; monitor ingestion volume and cost.
  • Phase 4: broaden to remaining services, add the config to the scaffolding template, publish on-call documentation.
  • Explicitly defer any full request-body capture until after the cost and privacy baselines are established.

Operational Impact

Maintenance

  • Very low ongoing engineering effort: one config file, no schema, no background processes. Upgrades are composer bumps behind a version pin.
  • Dependency risk is concentrated in a small maintainer team. Mitigate with a pinned minor version, a quarterly review, and an assumption that the team can fork — the package surface is small enough that a fork is a realistic contingency, not a bluff.
  • Lock-in is minimal: removal is a composer remove plus a config revert, with no data migration.

Support

  • Community-only support; no SLA, no vendor escalation. Ownership must sit with the platform/backend team, including the redaction policy and the enabled/disabled decision per environment.
  • Requires a named owner for the field dictionary — without it, the team forgets what fields exist and stops using the enrichment.

Scaling

  • Cost scales with request volume × payload size × number of enriched lines. This is the primary scaling constraint, not compute.
  • Mitigations to plan for up front: cap captured input size, truncate long values, sample high-volume channels, and route enhanced logs to a cheaper tier than error logs.
  • Latency impact is per-request and small, but non-zero on hot paths — measure rather than assume.

Failure modes

  • Silent no-op: a logging config change or tap-ordering conflict disables enrichment without error. Needs a smoke assertion in CI or a periodic log-shape check.
  • PII leakage: sensitive fields reach log storage and inherit its retention/access model. Highest-severity, lowest-detectability failure.
  • Context bleed under Octane: user or request identifiers attach to the wrong request, producing actively misleading debug data — worse than no data.
  • Volume/cost spike: a chatty endpoint or a large-payload route drives ingestion cost before anyone notices.
  • Truncation: oversized enriched lines get dropped by the aggregator, so the log you need most is the one that vanishes.
  • Log injection: unescaped input corrupts downstream parsing or forges entries.

Ramp-up

  • Minimal for engineers: the concept is familiar and there is no API to learn. Half a day for the integrating engineer, roughly an hour of on-call orientation.
  • The real ramp-up cost is organizational: establishing and socializing the redaction policy and the field dictionary. Budget that as the dominant effort, not the code.
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.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin