Weave Code
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

Psr Testlogger Laravel Package

colinodell/psr-testlogger

A lightweight PSR-3 TestLogger for unit tests. Capture log records in memory, inspect messages, contexts, and levels, and make assertions without external handlers. Helpful for verifying expected logging behavior in PHPUnit and other test suites.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Enables precise validation of logging behavior in unit tests (e.g., confirming error messages, context data) without external dependencies or infrastructure
  • Accelerates test-driven development by allowing immediate assertions on log records, reducing test flakiness and setup time
  • Supports roadmap goals for high-test-coverage features where audit trails or error handling are critical (e.g., payment processing, security events)
  • Eliminates "build vs buy" trade-offs for test utilities; this is a battle-tested, dependency-free solution vs custom implementations
  • Use cases: verifying security logs for failed auth attempts, ensuring transaction context is preserved in business logic, validating expected log levels during edge cases

When to Consider This Package

  • ✅ Ideal when writing PHPUnit or similar unit tests that require log verification (levels, messages, context)
  • ✅ When you need zero side effects (in-memory storage) and no real log handler configuration
  • ✅ For projects already using PSR-3 compliant logging interfaces
  • ❌ Avoid if tests already use built-in mocking (e.g., PHPUnit's MockObject for loggers) or require real disk-based logging for integration tests
  • ❌ Not suitable for end-to-end tests where log persistence is required; this is strictly for unit test isolation

How to Pitch It (Stakeholders)

Executives: "This package ensures our application's logging behavior is rigorously tested, preventing critical issues like missing error alerts or incorrect audit trails in production. It’s a lightweight, open-source tool that requires zero maintenance and delivers immediate ROI by catching logging bugs early in development."

Engineering: "Drop-in PSR-3 logger for tests that captures log records in memory—no setup, no disk writes. Simply assert on

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation
uri-template/tests