filisko/fake-psr3-logger

Fake PSR-3 logger implementation for integration testing

Maintainers

👁 filisko

Package info

github.com/filisko/fake-psr3-logger

pkg:composer/filisko/fake-psr3-logger

Statistics

Installs: 410

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v1.1.0 2025-05-12 12:41 UTC

Requires

Suggests

None

Provides

Conflicts

None

Replaces

None

MIT 78a07c0d0b7cb44002cbe569112fed99b9adb804

logtestingloggermockserverfakepsr-3

This package is auto-updated.

Last update: 2026-06-18 03:47:10 UTC


README

👁 Latest Version on Packagist
👁 Software License
👁 Testing
👁 Coverage Status
👁 Total Downloads

A package that provides a simple PSR-3 implementation for integration tests.

Requirements

  • PHP >= 7.1

Installation

This package is installable and autoloadable via Composer as filisko/fake-psr3-logger.

composer require filisko/fake-psr3-logger --dev

Usage

This package provides a PSR-3 (Psr\Log\LoggerInterface) implementation that allows you to verify the logging your code has made.

use Filisko\FakeLogger;

// PHP Unit scenario

$logger = new FakeLogger();
$logger->info('Something interesting happened', [
 'user_id' => 1
]);

// logs exposed
$logs = $logger->logs();

$this->assertSame([
 [
 'level' => 'info',
 'message' => 'Something interesting happened',
 'context' => [
 'user_id' => 1,
 ],
 ]
], $logs);

$this->assertSame(1, $logger->count());

Other testing utilities

Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.

The MIT License (MIT). Please see LICENSE for more information.