yiisoft/log
PSR-3-compatible logging library for Yii with configurable targets, message filtering, formatting, and context support. Route logs to files, syslog, email, or custom targets with flexible severity handling.
Architecture fit
yiisoft/log is a PSR-3-compatible logger from the Yii3 ecosystem, not a Laravel package. That distinction matters: it satisfies the interface Laravel depends on (Psr\Log\LoggerInterface), but it does not plug into Laravel's logging plumbing — the Log facade, channel configuration in config/logging.php, the stack/single/daily/slack drivers, or Monolog's handler and processor ecosystem. Architecturally it is a self-contained logger with its own message routing and writer/target model. For a Laravel-centric codebase, the realistic fit is as an isolated PSR-3 implementation inside a bounded service (a queue worker, a CLI tool, a shared internal library) rather than as a wholesale replacement for the framework's logging stack.
Integration feasibility
The mechanics are straightforward: it is a Composer package, PSR-3 conformant, PHP 8-era, and permissively licensed (BSD-3-Clause). A team can bind it into the container and resolve LoggerInterface from it in an afternoon. The friction is not installation but coexistence — running two logging implementations side by side means two configuration surfaces, two context-propagation conventions, and two sets of output formats. Any code written against Laravel's Log:: facade or Monolog-specific methods (withContext chains, handlers) will not see this logger, and vice versa.
Technical risk The dominant risk is ecosystem and maintenance risk, not code quality. At 43 stars the project has negligible community mass: few StackOverflow answers, few third-party integrations, and a bus factor concentrated in the Yii core team. It is a first-party Yii package, so it is not abandoned, but its roadmap is driven by Yii3's needs, not Laravel's. The stated last release of 2026-03-22 should be verified against the actual repository — a future-dated release signal is a data-quality flag and I would not plan against it until confirmed. Secondary risk: adopting a non-Monolog logger in a Laravel shop narrows the hiring pool and makes incident debugging less familiar to on-call engineers.
Key questions
Stack fit
Poor-to-moderate as a primary logger for a Laravel application; good as a scoped PSR-3 implementation in framework-agnostic internal packages. The clean architectural seam is the PSR-3 interface itself: depend on Psr\Log\LoggerInterface in business code, and let Laravel's default binding point at Monolog while specific services opt into yiisoft/log. This keeps the blast radius small and preserves the option to reverse the decision.
Migration path
Do not migrate existing logging. Instead, introduce the package additively: (1) add it as a dependency and write a thin adapter/binding that exposes it as LoggerInterface for a single non-critical service; (2) mirror its output into the existing Monolog channel during a shadow period so both streams are observable; (3) compare output fidelity, context handling, and performance under real load; (4) only expand scope if it demonstrates a measurable advantage. A full cutover would require reimplementing Laravel's channel semantics and is not justified by the package's current maturity.
Compatibility PSR-3 compliance gives broad interface compatibility, and BSD-3-Clause is unproblematic for commercial and redistributed use. Verify PHP version support against the fleet's runtime, confirm PSR-3 spec version alignment (1.x vs. the newer context-typing discussions), and check for conflicts if other dependencies pin Monolog — Composer will happily install both, but the team must be deliberate about which one any given class receives.
Sequencing Sequence as: dependency audit and license/version verification → proof-of-concept in one isolated worker or CLI command → adapter layer and dual-output shadow run → team review against Monolog baseline → decision gate (adopt narrowly, adopt broadly, or retire). Gate the broad-adoption decision on a documented, quantified benefit; absent that, keep the footprint at the proof-of-concept boundary.
Maintenance Low code-maintenance burden — it is a small, focused package — but non-trivial integration maintenance, because every Laravel upgrade that touches the logging pipeline becomes a compatibility checkpoint. Expect to own a thin adapter layer indefinitely. The real cost is divergence: two logging configurations to keep coherent, and a slow accumulation of "which logger does this service use?" tribal knowledge.
Support Support is community-only via the Yii project's channels, with no commercial backing and a very thin public knowledge base at 43 stars. Internal on-call engineers are unlikely to have prior exposure. Budget for at least one engineer to become the designated owner and to write the runbook; without that, incident response degrades precisely when logging matters most.
Scaling A PSR-3 logger is not the throughput bottleneck in most Laravel systems — the writers and transports are. Assess its behavior under high-volume writes, whether it buffers or flushes synchronously, and how it performs when the downstream sink (disk, syslog, remote collector) is slow or unavailable. For high-throughput queues, confirm it does not introduce blocking I/O on the request path; if it does, wrap it behind an async or buffered channel.
Failure modes The characteristic failures are: silent divergence (events written to the new logger never reach the dashboards and alerts built on Monolog), context loss (structured fields dropped because the two implementations serialize context differently), and dependency drift (a Laravel minor upgrade changes the container binding and the wrong logger gets injected). Each is preventable with a dual-output shadow period, schema assertions in tests, and an explicit container binding test.
Ramp-up Fast for a single engineer — PSR-3 is a known quantity and the API surface is small, so a competent PHP developer is productive in under a day. Slow for the organization: the ramp-up cost is not learning the package but establishing conventions, alerting parity, and ownership. Realistically plan two to three weeks of elapsed time from proof-of-concept to a confident adopt-or-retire decision, most of it spent on comparison and documentation rather than code.
TPM recommendation
Treat yiisoft/log as an evaluation candidate, not an adoption. Its PSR-3 conformance and BSD-3 license make it cheap to trial and cheap to remove. Its low adoption, Yii-centric roadmap, and the absence of Laravel-native integrations mean the burden of proof sits with the package: it must deliver a concrete, measurable advantage over Monolog for a defined use case before it earns a place in the stack. Approve a time-boxed proof-of-concept in one isolated service; do not approve any change to the framework's default logging path.
How can I help you explore Laravel packages today?