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

ActiveLibrary

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 1w 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

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

2301d 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

[team-reflex/discord-php

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

1.1k379.4k24](/packages/team-reflex-discord-php)[clue/docker-react

Async, event-driven access to the Docker Engine API, built on top of ReactPHP.

113154.9k1](/packages/clue-docker-react)[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.7k15.7k5](/packages/elgg-elgg)[toin0u/geotools

Geo-related tools PHP 7.3+ library

1.4k1.3k](/packages/toin0u-geotools)[discord-php/http

Handles HTTP requests to Discord servers

25318.7k8](/packages/discord-php-http)[zikarsky/react-gearman

A async implementation for gearman ontop of react

275.8k](/packages/zikarsky-react-gearman)

PHPackages © 2026

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