Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Dummy Logger

Dummy Logger Laravel Package

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.

View on GitHub
Deep Wiki
Context7

unreal4u/dummy-logger is a lightweight no-op PSR-3 logger for PHP and Laravel applications. It implements the standard logger interface while silently discarding every message, making it a drop-in replacement whenever you need logging to be effectively disabled—during tests, benchmarks, or in environments where log output is unwanted—without touching calling code.

  • Implements PSR-3 LoggerInterface with all severity levels
  • Every log call is a safe no-op: nothing is written, buffered, or dispatched
  • Drop-in swap for Monolog or Laravel's logger via container binding
  • Keeps tests fast and quiet by eliminating I/O and log noise
  • Zero configuration and no runtime dependencies beyond the interface
Frequently asked questions about Dummy Logger
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.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings