- Is yiisoft/log a Laravel package?
- No. yiisoft/log is a first-party PSR-3-compatible logger from the Yii3 ecosystem, so it satisfies Psr\Log\LoggerInterface but does not integrate with Laravel's logging plumbing. It ships no service provider, no Log facade hook, and no config/logging.php channel driver, so Laravel will not discover or use it automatically. Treat it as a standalone logger rather than a Laravel logging package.
- How do I install yiisoft/log in a Laravel application?
- Install it with Composer via composer require yiisoft/log. There is no Laravel auto-discovery, so nothing is registered for you and Laravel's existing Monolog-based stack stays untouched. You then wire it manually into the container or instantiate it directly inside the specific service that should use it. It is PHP 8-era code and permissively licensed under BSD-3-Clause.
- Can I replace Laravel's default logger with yiisoft/log?
- You technically can bind LoggerInterface to it, but it is not recommended as a wholesale replacement. yiisoft/log does not implement Laravel's channel semantics, the stack/single/daily/slack drivers, or Monolog's handler and processor ecosystem, so a full cutover means reimplementing behavior the framework gives you for free. The safer pattern is to keep Monolog as the application default and opt into yiisoft/log in one bounded service.
- How do I bind yiisoft/log to Laravel's service container as LoggerInterface?
- Create a thin adapter or factory and register it in a service provider so that Psr\Log\LoggerInterface resolves to your configured yiisoft/log instance. Scope that binding to a single non-critical service rather than rebinding the interface globally, since Laravel's own internals expect Monolog. This keeps the blast radius small and preserves an easy reversal if the experiment does not pay off.
- Does yiisoft/log support Laravel log channels like single, daily, stack, or slack?
- No. yiisoft/log has its own target and writer model with configurable message filtering, formatting, and context support, which is a different abstraction from Laravel's channel drivers. Routing to files, syslog, email, or custom targets is handled through its own configuration surface, not config/logging.php. Running both means maintaining two separate configuration surfaces and two output formats.
- What is yiisoft/log's maintenance status, and is the reported 2026 release date accurate?
- It is a first-party Yii package maintained by the Yii core team, so it is not abandoned, but its roadmap follows Yii3's needs rather than Laravel's. The project has a small community footprint, so expect limited third-party integrations and few answers to Laravel-specific questions. The stated last release date of 2026-03-22 appears to be future-dated, which is a data-quality flag; verify the actual commit cadence and tags on the GitHub repository before planning against it.
- What are the risks of running yiisoft/log alongside Monolog in a Laravel app?
- The main friction is coexistence rather than installation: two loggers mean two configuration surfaces, two context-propagation conventions, and two output formats. Code written against the Log facade or Monolog-specific methods will not see yiisoft/log events, and vice versa, which complicates incident debugging for on-call engineers. You may also lose access to Monolog-first observability integrations such as Sentry, Datadog, or OpenTelemetry if those are part of your stack.
- How do I test code that depends on yiisoft/log in a Laravel test suite?
- Depend on Psr\Log\LoggerInterface in your business code rather than the concrete yiisoft/log class, then substitute a NullLogger or an in-memory test double in your tests. PSR-3 gives you that swap for free and keeps your tests independent of the chosen implementation. If you do need to assert real behavior, instantiate yiisoft/log with a test target and inspect the recorded messages directly.
- What license does yiisoft/log use, and is it safe for commercial use?
- It is released under BSD-3-Clause, which is permissive and unproblematic for commercial and redistributed use. That makes it low risk from a legal standpoint compared with copyleft alternatives. As always, confirm the license file in the repository tag you actually install and check it against your organization's dependency policy.
- When should a Laravel team choose yiisoft/log over Monolog?
- Choose it only in a scoped, framework-agnostic context, such as a shared internal library, a CLI tool, or a queue worker that must not depend on the framework's logging stack. For general application logging in Laravel, Monolog plus a PSR-3 binding covers the same contract with far broader ecosystem support. Introduce yiisoft/log additively, mirror its output into an existing Monolog channel during a shadow period, and only expand its scope if it shows a measurable advantage.