PHPackages                             flotzilla/logger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. flotzilla/logger

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

flotzilla/logger
================

PSR-3 logger implementation

1.1.0(6y ago)22MITPHPPHP ^7.3CI failing

Since Apr 15Pushed 6y ago1 watchersCompare

[ Source](https://github.com/flotzilla/logger)[ Packagist](https://packagist.org/packages/flotzilla/logger)[ RSS](/packages/flotzilla-logger/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (2)Dependencies (4)Versions (4)Used By (0)

[![MIT License](https://camo.githubusercontent.com/da09026611ef483db9af4349dc98d050ee6f8e605c33d138256270d696009122/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f74686e65696c647265772f426573742d524541444d452d54656d706c6174652e7376673f7374796c653d666c61742d737175617265)](https://github.com/flotzilla/container/blob/master/LICENCE.md)

Logger
======

[](#logger)

PSR-3 logger interface implementation inspired by monolog

Requirements
------------

[](#requirements)

`php > 7.3`

Install
-------

[](#install)

via Composer

```
$ composer require flotzilla/logger
```

Description
-----------

[](#description)

Basic usage
-----------

[](#basic-usage)

```
$logger = new Logger();
$channel = new Channel('logs', [
        new FileHandler( new SimpleLineFormatter())
    ]);

$logger->addChannel($channel);

$logger->info('some data');
$logger->error('some message', ['data' => ['name' => 'John', 'job' => 'night watcher']]);
```

Advanced usage
--------------

[](#advanced-usage)

Initialization

```
use \flotzilla\Logger\Channel\Channel;
use \flotzilla\Logger\Formatter\JsonFormatter;
use \flotzilla\Logger\Handler\ConsoleHandler;
use \flotzilla\Logger\Handler\FileHandler;
use \flotzilla\Logger\Logger;
use \flotzilla\Logger\LogLevel\LogLevel;
use \flotzilla\Logger\Formatter\PsrFormatter;
use \flotzilla\Logger\Formatter\SimpleLineFormatter;

$logger = new Logger();

//output will be written to /tmp/main-logs.log
$channel = new Channel('logs-all', [
        new FileHandler(new SimpleLineFormatter(), '/tmp', 'main-logs')
    ]);

// set log levels for this channel
$debugChannel = new Channel('debug', [
        new FileHandler(new SimpleLineFormatter(), 'tmp', 'debug'),
        new FileHandler(new PsrFormatter()) // /tmp dir by default
    ], LogLevel::DEBUG, LogLevel::NOTICE);

$criticalChannel = new Channel('critical-only', [
        new FileHandler(new SimpleLineFormatter(), '/tmp', 'critical'),
        new FileHandler(new JsonFormatter(), '/tmp', 'critical')
    ], LogLevel::CRITICAL, LogLevel::EMERGENCY);

// write output to console
$channel = new Channel('logs', [
        new ConsoleHandler(new SimpleLineFormatter())
    ]);

// add channels
$logger->addChannel($channel);
$logger->addChannel($debugChannel);
$logger->addChannel($criticalChannel);

// or set them all
$logger->setChannels([$channel, $debugChannel, $criticalChannel]);

// or pass to constructor
$logger = new Logger([$channel, $debugChannel, $criticalChannel]);
```

Channels

```
// disable channel for writing
$logger->getChannel('debug')->setEnabled(false);

// set maximal log level for filtering
$logger->getChannel('test')->setMaxLogLevel('error');

// set minimal log level for filtering
$logger->getChannel('test')->setMinLogLevel('info');
```

Set custom datetime format and timezone

```
$logger = new Logger($channels, 'Y.j.m', new DateTimeZone('Europe/London'));
```

Testing
-------

[](#testing)

```
$ composer test
$ composer test_mock
```

Benchmarks
----------

[](#benchmarks)

```
$ composer bench
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/flotzilla/logger/blob/master/LICENCE.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

2223d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/def6433e750502668fe08ee10172c8bcc021b72c770668ed7eb3d4f3027cff1e?d=identicon)[bbyte](/maintainers/bbyte)

---

Top Contributors

[![0bbyte](https://avatars.githubusercontent.com/u/3332506?v=4)](https://github.com/0bbyte "0bbyte (51 commits)")

---

Tags

loglogginglogger

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/flotzilla-logger/health.svg)

```
[![Health](https://phpackages.com/badges/flotzilla-logger/health.svg)](https://phpackages.com/packages/flotzilla-logger)
```

###  Alternatives

[analog/analog

Fast, flexible, easy PSR-3-compatible PHP logging package with dozens of handlers.

3451.5M24](/packages/analog-analog)[inpsyde/wonolog

Monolog-based logging package for WordPress.

183617.9k7](/packages/inpsyde-wonolog)[amphp/log

Non-blocking logging for PHP based on Amp, Revolt, and Monolog.

402.6M70](/packages/amphp-log)[apix/log

Minimalist, thin and fast PSR-3 compliant (multi-bucket) logger.

511.0M18](/packages/apix-log)[markrogoyski/simplelog-php

Powerful PSR-3 logging. So easy, it's simple.

2818.1k4](/packages/markrogoyski-simplelog-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
