- What is unreal4u/dummy-logger used for?
- It is a no-op implementation of the PSR-3 LoggerInterface, so any log call accepts the message and discards it without writing to a file, stream, or handler. Developers reach for it in unit tests, CLI and Artisan contexts, or library code that must depend on a logging abstraction without forcing a concrete logger on consumers. It is the null-object pattern applied at the logging seam.
- Does unreal4u/dummy-logger work with Laravel 10 or 11?
- Not out of the box. The last release was January 2018 and targets psr/log ^1.0, while Laravel 10 and 11 ship Monolog 3 and resolve psr/log ^3.0, which introduced typed interface signatures. A logger written against ^1.0 does not satisfy the ^3.0 interface and will fatal at class load. Confirm on a scratch branch with composer require --dry-run before assuming anything.
- How do I install unreal4u/dummy-logger with Composer?
- Run composer require unreal4u/dummy-logger. Installation itself is trivial, but the package only resolves cleanly on projects still pinned to psr/log v1.x. On a current Laravel stack Composer will either reject the constraint or you will hit a class-load fatal at runtime, so check the resolution result rather than the exit code alone.
- Is unreal4u/dummy-logger a good way to silence logging in tests?
- It is unnecessary. psr/log already ships Psr\Log\NullLogger, which is the same no-op logger and is already present transitively in every Laravel application via Monolog. Swapping in NullLogger costs nothing and removes a dependency whose upstream has seen no activity since 2018.
- What is the difference between unreal4u/dummy-logger and Psr\Log\NullLogger?
- Functionally there is essentially no difference: both implement PSR-3 and discard every message. The difference is provenance. NullLogger is maintained by the PHP-FIG as part of psr/log and tracks every PSR-3 interface change, while dummy-logger is a personal utility frozen at psr/log ^1.0.
- How do I replace unreal4u/dummy-logger with Psr\Log\NullLogger?
- Remove the Composer requirement and change the use statement from unreal4u\DummyLogger to Psr\Log\NullLogger. Nothing else needs to change because both classes satisfy LoggerInterface. If it is already installed, it is effectively a rename-only migration.
- Is unreal4u/dummy-logger still maintained?
- No. The repository has had no commits since January 2018, has 3 stars and 0 dependents, and is a single-maintainer project with no downstream users generating triage pressure. Adopting it means inheriting the support obligation without inheriting the repository, and the realistic risk is dependency rot rather than a CVE.
- Can a no-op logger like unreal4u/dummy-logger hide errors in production?
- Yes, and that is the highest-impact risk. A dummy logger bound in a misconfigured environment produces no errors and no logs, so failures stay invisible precisely on the paths where observability matters most. If you use it at all, restrict it to tests and dry-run commands, never as a placeholder default binding in production.
- How do I bind a null logger in Laravel without installing this package?
- Use the container: $this->app->instance(LoggerInterface::class, new Psr\Log\NullLogger()) in a test case or service provider. Laravel's container makes the package redundant even at the narrow seams where a PSR-3 dummy is appropriate. Alternatively vendor a roughly ten-line class extending Psr\Log\AbstractLogger.
- What should I check before adding unreal4u/dummy-logger to a Laravel project?
- Check which psr/log constraint your application resolves today and whether anything is holding it below 2.0. Also confirm the intent: a null logger for tests and CLI is sound, but a placeholder default binding until a real logger is wired is an operational hazard. Run composer require --dry-run to see the actual constraint resolution before committing.