celema/log

A simple PSR-3 Logger

Maintainers

Package info

codeberg.org/celema/log

Homepage

Issues

pkg:composer/celema/log

Transparency log

Statistics

Installs: 6

Dependents: 0

Suggesters: 0

0.4.0 2026-07-18 23:22 UTC

This package is auto-updated.

Last update: 2026-07-18 21:24:18 UTC


README

ci code coverage type coverage psalm level Software License

A simple PSR-3 logger using PHP's error_log function.

Installation

composer require celema/log

Usage

Create a logger without arguments to write to PHP's default SAPI error logger.

use Celema\Log\Logger;

$logger = new Logger();
$logger->info('Application started');

See the documentation for file logging, level filtering, and formatter usage.

Testing

During testing, PHP's error_log ini setting is set to a temporary file. To print the output to the console, prepend a special env variable to the PHPUnit cli command, as follows:

ECHO_LOG=1 phpunit

Test Environment Requirements

Tests require:

  • ini_set() function enabled (for error_log redirection)
  • Writable system temp directory (for test log file isolation)
  • PHP error_reporting must be modifiable

These are standard in development environments but may fail in restricted PHP configurations where ini_set is disabled via disable_functions.

License

This project is licensed under the MIT license.