1
0
Fork
You've already forked log
0
A simple PSR-3 Logger
  • PHP 100%
Thomas Ernst 6bdf56b6f7
All checks were successful
ci / ci (push) Successful in 1m7s
Update README badges
2026年06月10日 21:22:55 +02:00
.forgejo/workflows Allow manual CI runs 2026年06月10日 20:58:19 +02:00
.github Update github readme 2026年06月10日 18:50:58 +02:00
docs Update docs tooling 2026年05月12日 15:00:38 +02:00
src The big rename 2026年05月11日 14:07:23 +02:00
tests The big rename 2026年05月11日 14:07:23 +02:00
.editorconfig Sync shared config files 2026年01月30日 21:51:15 +01:00
.gitattributes Update .gitattributes 2026年04月29日 10:05:26 +02:00
.gitignore Update coverage path 2026年04月30日 17:00:47 +02:00
CHANGELOG.md Release v0.3.0 2026年06月10日 18:51:59 +02:00
composer.json Require dev package v4.2 2026年05月13日 13:12:06 +02:00
LICENSE.md Update license 2026年05月12日 20:35:56 +02:00
mago.toml Add linter rules 2026年04月30日 18:18:12 +02:00
phpunit.xml.dist Update coverage config 2026年05月12日 19:55:34 +02:00
psalm.xml.dist Rename phpunit and psalm config 2026年04月30日 16:57:03 +02:00
README.md Update README badges 2026年06月10日 21:22:55 +02:00

Celemas Log

ci code coverage type coverage psalm level Software License

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

Installation

composer require celemas/log

Usage

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

use Celemas\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.