illuminate/log
Laravel's logging component provides a PSR-3 compatible logger with powerful channel-based configuration, built-in Monolog integration, and handlers for single files, daily rotation, stacks, syslog, and error logs. It supports contextual logging and custom drivers for flexible application logging.
Architecture fit. illuminate/log is a subtree split of the Laravel framework, not a standalone library. It is the right component only if the target system is a Laravel application (or a package that must behave identically to one). It binds directly to Laravel's container, configuration conventions, and the illuminate/contracts + illuminate/support dependency chain. For a polyglot or framework-agnostic estate, this is the wrong primitive — Monolog or a thin PSR-3 wrapper is the better unit of adoption. The value is standardization inside Laravel, not portability outside it.
Integration feasibility. High inside Laravel: it is already installed, already wired through config/logging.php, and already backing the Log facade — adoption cost is essentially zero. Feasibility collapses for standalone PHP: the subtree split ships Illuminate\Log\Logger but not LogManager, so there is no config loader, no Log::channel(), no Log::stack(). You must hand-wire Monolog handlers per channel. At that point the package adds little over Monolog directly.
Technical risk. The dominant risks are version-coupling and environment baseline, not correctness:
laravel/framework, not to this package.Key questions for the team:
channel(), stack(), dynamic driver config) that only exist with the full framework?illuminate/* transitive dependencies?Stack fit. Adopt inside Laravel applications on PHP 8.3+ and Monolog 3.x. Do not adopt as a general logging layer for non-Laravel services, CLI tools, or shared libraries — the dependency weight and missing manager make it a net negative there.
Migration path. Two distinct scenarios:
config/logging.php as the single source of truth, standardize channel names (single, daily, stderr, slack), and document conventions for context payloads. Migration work is governance, not code.config/logging.php shape. Only use illuminate/log's Logger if you explicitly need parity with Laravel output formatting or are writing a Laravel-facing package. Do not pull it in "just for the facade."Compatibility. PSR-3 is the stable contract — program against Psr\Log\LoggerInterface, not Illuminate\Log\Logger, so the concrete implementation remains swappable. Audit every custom handler, formatter, and processor for Monolog 3.x compatibility before the first deploy. Where the full Log facade is available, use Log::channel()/Log::stack(); do not reimplement them in standalone code.
Sequencing:
composer.json and CI.Tap classes for contextual enrichment/scrubbing) per environment.Maintenance. Low effort, but not zero-ownership: the package is maintained upstream by the Laravel team and consumed here as a dependency. The maintenance burden is concentrated in framework upgrade events, where logger behavior, formatter defaults, and Monolog major bumps can change together. Budget a review checkpoint in every Laravel major upgrade.
Support. Documentation lives in the Laravel logging docs, not on the package repo; the subtree split has no independent changelog. Support escalation is effectively "file upstream against laravel/framework." Internal teams should not expect package-level SLAs.
Scaling. Adequate for typical application logging; constrained at high volume. The single channel does not rotate — use daily or external handlers for anything sustained. The slack and syslog channels introduce outbound network dependencies on the request path and become a latency and blast-radius risk under load. There is no built-in asynchronous/buffered dispatch: high-throughput or latency-sensitive workloads need a queue-backed handler or a log shipper. Tap classes are the correct hook for redaction and metadata at scale — enforce them centrally rather than per-call-site.
Failure modes to design against:
storage/logs — define rotation, retention, and disk alerts; a full volume can cascade into application errors.Tap-based scrubbing.Ramp-up. Near-zero for Laravel engineers, who already use the facade daily; the learning curve is in conventions (channels, taps, context schema), not API. For standalone adopters, expect meaningful ramp-up: engineers must understand Monolog handler composition, since the package supplies the wrapper but not the configuration scaffolding. Recommended enablement: a one-page logging standard plus two reference configurations (Laravel and standalone) covers most of the gap; allocate a short design review rather than formal training.
How can I help you explore Laravel packages today?