PHPackages                             sunvalley-technologies/react-php-file-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. sunvalley-technologies/react-php-file-logger

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

sunvalley-technologies/react-php-file-logger
============================================

A simple PSR file logger for react php

2.0.0(6y ago)411.1kMITPHPPHP ~7.2CI failing

Since Jan 15Pushed 6y ago1 watchersCompare

[ Source](https://github.com/sunvalley-technologies/react-php-file-logger)[ Packagist](https://packagist.org/packages/sunvalley-technologies/react-php-file-logger)[ RSS](/packages/sunvalley-technologies-react-php-file-logger/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (5)Dependencies (7)Versions (6)Used By (0)

React PHP File Logger
=====================

[](#react-php-file-logger)

A PSR non-blocking file logger for react php. Uses monolog and provides non blocking monolog handlers.

Installing
----------

[](#installing)

`composer require sunvalley-technologies/react-php-file-logger`

Usage
-----

[](#usage)

Convenient loggers that create a quick monolog logger available as `FileLogger`, `RotatingFileLogger` and `StdIOLogger`.

These loggers are just a quick short-cut to use the non blocking handlers specified below.

#### Monolog/StreamHandler

[](#monologstreamhandler)

```
use Monolog\Logger;
use React\Stream\WritableResourceStream;
use SunValley\LoopUtil\FileLogger\Monolog\StreamHandler;

$logger = new Logger('name');
$loop = \React\EventLoop\Factory::create();
$logger->pushHandler(new StreamHandler(new WritableResourceStream(STDOUT, $loop)));
$logger->info('Message!!!');
$loop->run();
```

#### Monolog/StdIOHandler

[](#monologstdiohandler)

```
use Monolog\Logger;
use SunValley\LoopUtil\FileLogger\Monolog\StdIOHandler;

$logger = new Logger('name');
$loop = \React\EventLoop\Factory::create();
$logger->pushHandler(new StdIOHandler($loop));
$logger->info('Message!!!');
$loop->run();
```

#### Monolog/FileHandler

[](#monologfilehandler)

```
use Monolog\Logger;
use SunValley\LoopUtil\FileLogger\Monolog\FileHandler;

$logger = new Logger('name');
$loop = \React\EventLoop\Factory::create();

$logFile = __DIR__ . '/test.log';
// expect log file like test-1999-12-31.log
$logger->pushHandler(new FileHandler($loop, $logFile));
$logger->info('Message!!!');
$loop->run();
```

### Note

[](#note)

Since version 2, this library removed react/filesystem support and `RotatingFileHandler` for simplicity and ordered writes. The old version should still work fine though performance wise keeping some child processes around for some logs might not be that desirable.

Since version 2, this library opens the file with `n` (`O_NONBLOCK`) and handles the file with a writable stream. This probably does not work on Windows and might even be not really that non-blocking open but the stream itself will be non-blocking. It also by default opens a log file with a date prefix (which can be disabled) and listens for a SIGHUP signal to close and reopen the file stream. This simply replaces a "rotating log file". Use `logrotate` for better rotating of files. Since the log file stream will be opened once, this should not actually be a problem for a blocking problem on Windows as well.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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 ~3 days

Total

5

Last Release

2346d ago

Major Versions

1.0.3 → 2.0.02020-01-30

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18337504?v=4)[bmlkc](/maintainers/bmlkc)[@bmlkc](https://github.com/bmlkc)

---

Top Contributors

[![bmlkc](https://avatars.githubusercontent.com/u/18337504?v=4)](https://github.com/bmlkc "bmlkc (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sunvalley-technologies-react-php-file-logger/health.svg)

```
[![Health](https://phpackages.com/badges/sunvalley-technologies-react-php-file-logger/health.svg)](https://phpackages.com/packages/sunvalley-technologies-react-php-file-logger)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[illuminate/log

The Illuminate Log package.

6225.3M622](/packages/illuminate-log)[team-reflex/discord-php

An unofficial API to interact with the voice and text service Discord.

1.1k420.9k26](/packages/team-reflex-discord-php)[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k16.4k79](/packages/elgg-elgg)

PHPackages © 2026

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