unreal4u/dummy-logger
A lightweight dummy logger for Laravel and PHP that implements the logging interface while discarding every message. Ideal for tests, benchmarks, and environments where you need a silent, zero-overhead stand-in for a real PSR-3 logger without changing existing code.
Architecture fit. The package does exactly one thing: it implements Psr\Log\LoggerInterface as a no-op so that classes can depend on a logging abstraction without forcing a concrete logger into the dependency graph. That is the null-object pattern applied at the logging seam, and it is a legitimate architectural move — particularly for unit tests of services that type-hint PSR-3, for CLI/artisan contexts where logging is meaningless, and for library code that must not impose a logger on its consumers.
The problem is that the pattern is already served by the standard. psr/log ships Psr\Log\NullLogger, and Psr\Log\AbstractLogger reduces a hand-rolled no-op to a single log() method of roughly ten lines. The package description — "so that my own classes can work with a common base" — frames it as a personal utility extracted into a repo, not a library solving a general problem. Against that, 3 stars, 0 dependents, and a score of 0.075 describe a project with no external validation.
Integration feasibility. Composer installation is trivial; the binding constraint is the PSR-3 version. The last release is January 2018, predating psr/log 2.0 and 3.0. psr/log 3.0 added typed interface signatures (string|\Stringable $message, array $context = []): void); a logger written against psr/log ^1.0 does not satisfy the ^3.0 interface and fatals at class load. Modern Laravel — 10/11 with Monolog 3 — resolves psr/log ^3. So the honest feasibility answer is "technically installable, practically incompatible with a current stack." That should be confirmed with a scratch-branch composer require --dry-run rather than reasoned about further.
Technical risk.
Key questions.
Psr\Log\NullLogger — e.g., a type-hinted injection point that can't accept the standard class?Verdict: sound in concept, non-viable as a package. Adopt the pattern, not the dependency.
Stack fit. In Laravel, log is bound to Monolog and the Log facade covers application logging. A PSR-3 dummy is therefore relevant only at narrow seams: service unit tests, dry-run commands, and packages that must not assume a logger. Laravel's container makes the package redundant even there — $this->app->instance(LoggerInterface::class, new NullLogger()) in a test case or service provider achieves the same result with zero dependencies and zero version risk.
Migration path.
use unreal4u\DummyLogger\... with Psr\Log\NullLogger, delete nothing else. Rename-only change.psr/log, which is already transitively present in every Laravel application via Monolog.docs/ note recording that null logging is Psr\Log\NullLogger in this codebase, so the question does not resurface each time someone wants a throwaway logger.Compatibility. Validate the psr/log constraint before anything else — this is the single gate on the whole evaluation. If the app resolves psr/log ^2 or ^3, the package is a non-starter and the analysis ends. If we control an internal package that pulled this in transitively, fix it at that package's next release rather than at the consuming application.
Sequencing. Fold this into whatever ticket already touches the logging seam. It does not warrant a dedicated migration ticket — it is a rename, not a migration, and 0 dependents on the package means our removal breaks nothing upstream or downstream. If the swap is bundled with a real logging change, do the swap first and land it separately so a rollback of one does not roll back the other.
Maintenance. No viable upstream. Last release January 2018, single author, personal-scope project, no dependents generating patch pressure. Once we depend on it, we own the code without owning the repository — the worst of both arrangements. Any future psr/log incompatibility would be ours to patch in a fork.
Support. No SLA, no issue triage, no security advisory channel. Absolute security exposure is low because a no-op has almost no attack surface, but "unmonitored" is still a dependency-risk category that should be registered under whatever policy governs third-party packages, if only so it appears on a future audit and gets removed.
Scaling. Computationally irrelevant — a no-op logger is the cheapest possible object at any throughput. The scaling concern is organizational: if the dummy logger becomes the default binding in an environment that serves traffic, we lose logs on exactly the failure paths where we need them, and we pay for that during incidents rather than during code review. Null logging must be scoped to test and CLI contexts explicitly, never inherited by default.
Failure modes.
Ramp-up. Minutes for any PHP developer comfortable with PSR-3. The documentation burden is actually negative: there is more to explain about why a bespoke dummy logger exists than about how to use it, and the explanation invites the obvious follow-up — "why not NullLogger?" — which has no good answer.
Recommendation: reject as a dependency; adopt the pattern via Psr\Log\NullLogger, already in the tree of every Laravel application we run.
How can I help you explore Laravel packages today?