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 Json Context Logging Laravel Package

czim/laravel-json-context-logging

A Laravel logging package that adds structured JSON context to log entries, helping you attach request, user, and custom data consistently for easier debugging, filtering, and search across application logs.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Observability roadmap: standardize structured logging or keep it ad hoc. Every Laravel service we run emits logs, but if each one formats them differently, we pay for it in incident response (MTTR), on-call ergonomics, and SLO reporting. This package is a candidate "shared logging convention" — JSON records with consistent context fields — which is the prerequisite for cheap log search, filtering, and alerting. The PM decision is whether to fund a logging standard at all, and if so, whether this is the vehicle.
  • Build vs. buy vs. wrap. Laravel's native logging stack (Monolog channels, config/logging.php, JsonFormatter, Log::withContext(), and the Context middleware added in Laravel 8) already covers a large share of what this package advertises. A buy decision here has to be justified by something native config doesn't do cheaply — typically context enrichment via configurable processors kept in one maintained place across many repos. A "wrap" decision (a ~50-line internal processor registered per app, or a tiny shared internal package) is a credible third option and should be on the table.
  • Dependency and maintenance policy. Last release is March 2019, it is pre-1.0 (0.9.x), and it has 3 GitHub stars with 0 dependents. That is effectively a single-maintainer micro-library with no community validation. It almost certainly predates Laravel 8/9/10/11 and PHP 8. The real PM decision this drives is not "is JSON logging nice" but "what is our policy for adopting an unmaintained third-party dependency into a cross-cutting concern like logging?" — because logging is the one subsystem you cannot afford to have silently break.
  • Audit, compliance, and PII handling. If regulated or enterprise customers require retention, tamper-evident trails, or PII redaction in logs, logging stops being a developer convenience and becomes a roadmap item with contract-level requirements. This package's "configurable processors" idea is relevant (redaction is a processor), but an unmaintained dependency is a poor home for a compliance control.
  • Consolidation and exit-cost decisions. Because the library is a thin layer over Monolog/PSR-3, adopting it is reversible via config. That low exit cost is the strongest argument in its favor — and the reason a bounded trial is a cheap decision to make rather than a debate.
  • Trial scoping and timeboxing. With zero dependents and a stale release, the only defensible position is an evaluation spike in one non-critical service, timeboxed, with a written fallback to native Monolog formatting. That is a PM-owned scoping decision, not an engineering preference.

When to Consider This Package

Adopt — or, more realistically, trial — when:

  • We run several Laravel services and want JSON context enrichment (request ID, tenant ID, user ID, correlation ID) maintained in one place instead of copy-pasted middleware and formatters per repo.
  • The team has already confirmed the package installs and runs on our actual PHP/Laravel versions. Given the 2019 release date, this must be verified by spike, not assumed — the Composer constraint may not even resolve against a modern Laravel.
  • We want structured output without building a logging platform: the package is a thin layer over Monolog, so the exit path is a config swap and a formatter change, not a migration.
  • We are explicitly treating it as a read-for-ideas reference implementation rather than a runtime dependency — the configurable-processor approach is a good design to copy in-house, and copying it costs nothing and carries no maintenance risk.

Look elsewhere or defer when:

  • We need API stability or a support commitment. Pre-1.0 plus a seven-year-dormant release is not a stable contract. A cross-cutting logging library that changes signatures without a major bump, or never gets security fixes, is expensive in exactly the place we can least tolerate surprise.
  • Native Laravel already covers it. If the need is "JSON logs" or "add context to every record," modern Laravel/Monolog does this with a formatter and a processor. Reaching for a third-party package here adds a dependency and an upgrade surface for near-zero incremental gain.
  • Compliance or audit logging is in scope. An unmaintained single-maintainer package should not sit in a regulated evidence path. Build the redaction and retention controls in-house on top of a maintained foundation.
  • The team cannot absorb a silent-failure class of bug. Logging failures are quiet — you discover them during the incident you needed logs for. If we have no smoke test asserting that log emission, formatting, and context enrichment actually work, this package's risk profile is worse than its feature list.
  • Nobody will own the fork. This is the deciding criterion. If we adopt, we must be willing to pin, vendor, or fork it. If no team will own that, don't adopt.

How to Pitch It (Stakeholders)

For executives: This is infrastructure, not a customer-facing feature. Its value shows up in two places: faster incident diagnosis (lower MTTR, calmer on-call) and a checkbox in enterprise/compliance reviews about log quality and traceability. The honest assessment of this specific package is that it is a small, elegant idea carrying meaningful maintenance risk — last released in 2019, pre-1.0, a handful of stars, no downstream dependents, effectively one maintainer. It is not a platform to standardize on. Recommendation: do not adopt as a dependency. Instead, fund a short evaluation spike in one non-critical service to harvest its design — structured JSON records with configurable context processors — and implement that pattern on top of Laravel's maintained native logging stack. This gets us the observability benefit and the compliance story, with an exit cost of zero and no orphaned dependency in a load-bearing subsystem. If the team prefers to adopt as-is, the decision needs an explicit named owner for pinning, patching, and eventually forking, plus a written fallback plan.

For engineering: The package layers JSON formatting and processor-based context enrichment over Monolog and Laravel's logging channels. The 0.9.1 release fixed an interface/implementation mismatch in the logger factory — a real LSP violation where type-hinting or container resolution could fail at runtime — but that is the last sign of life, from March 2019, and it almost certainly predates PHP 8 and Laravel 9+. Before any adoption discussion, run a two-day spike that answers: does it resolve and install on our current Laravel/PHP versions, does the emitted JSON survive our log pipeline, and what does a modern native equivalent cost? The native equivalent is roughly a JsonFormatter on the channel plus a processor or Log::withContext() middleware for request/tenant/user IDs — small, tested, and ours. Action items: (1) treat any prior container-binding workaround for the factory as evidence the package was fragile in our hands, and delete it if we drop the dependency; (2) add a smoke test asserting logs emit with expected keys and context, so formatting regressions fail CI rather than production; (3) if we do adopt transiently, pin the exact version, vendor it, and review every bump for interface changes that won't announce themselves as breaking. Upgrade risk within the 0.9.x line is low — the 0.9.1 change corrected a declaration without removing public API — but the risk of adopting a dormant package into a cross-cutting concern is not low.

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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console