PHPackages                             smalex86/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. smalex86/logger

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

smalex86/logger
===============

Simple logging system

v1.7.8(7y ago)05[8 issues](https://github.com/smalex86/logger/issues)/LICENCEPHPPHP &gt;=7.0.0

Since Dec 11Pushed 7y agoCompare

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

READMEChangelog (7)Dependencies (1)Versions (17)Used By (0)

Logger
======

[](#logger)

Simple logging system suitable with PsrLog.

- Logger - base logger class including and managed routes
- Route - base class for routes
- SimpleLoggerFactory - factory simple (file) logger
- SimpleStaticLogger - not suitable with PsrLog
- route:
    - CachedFileRoute - route for file logging with cache using
    - ConsoleRoute - route for output log info console (for cli mode)
    - ConsoleRouteWithPid - route for output log info console with process id info (for cli mode)
    - DatabaseRoute - route for database logging
    - FileRoute - ex SimpleLogger, route for file logging
    - FileRouteWithPid - route for file logging with print of process id into log message
    - SyslogRoute - syslog route
- tests

To use this logger write to composer.json:
------------------------------------------

[](#to-use-this-logger-write-to-composerjson)

```
{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/smalex86/logger"
        }
    ],
    "require": {
        "smalex86/logger": "1.7.8"
    }
}
```

And add text below to your project:
-----------------------------------

[](#and-add-text-below-to-your-project)

Use it with autoloader PSR-4:

```
use smalex86\logger\Logger;
```

If you want to use dynamic object suitable with Psr\\Log\\LoggerInterface write to project these commands:

```
$logger = new Logger();
$logger->routeList->attach(new smalex86\logger\route\FileRoute([
    'isEnabled' => true,
    'maxLevel' => 7,
    'logFile' => 'test.log',
    'folder' => dirname(__DIR__, 2) . '/logs/'
]));
$logger->routeList->attach(new smalex86\logger\route\CachedFileRoute([
    'isEnabled' => true,
    'maxLevel' => 7,
    'logFile' => 'cacheTest.log',
    'folder' => dirname(__DIR__, 2) . '/logs/',
    'cacheSize' => 50
]));
$logger->routeList->attach(new smalex86\logger\route\ConsoleRoute([
    'isEnabled' => true,
    'maxLevel' => 7
]));
$logger->routeList->attach(new smalex86\logger\route\ConsoleRouteWithPid([
    'isEnabled' => true,
    'maxLevel' => 7
]));
$logger->routeList->attach(new smalex86\logger\route\DatabaseRoute([
    'isEnabled' => true,
    'maxLevel' => 6,
    'dsn' => 'mysql:host=localhost;port=3306;dbname=test',
    'username' => 'root',
    'password' => '',
    'table' => 'project_log'
]));
$logger->routeList->attach(new smalex86\logger\route\SyslogRoute([
    'isEnabled' => true,
    'maxLevel' => 5
]));
$logger->info('info', ['class'=>'Logger', 'method'=>'getName', '38']); // PsrLog style
```

### Some examples

[](#some-examples)

```
$logger->emergency('emergency test', ['test'=>'value', '32']);
$logger->alert('alert test', ['test'=>'value', 1=>'33']);
$logger->critical('critical test');
$logger->error('error test', ['34', '35']);
$logger->warning('warning test', ['36', '37']);
$logger->notice('notice test');
$logger->info('info', ['class'=>'Logger', 'method'=>'getName', '38']);
$logger->debug('debug test', [__LINE__]);
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity66

Established project with proven stability

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

Total

15

Last Release

2767d ago

PHP version history (2 changes)v1.4PHP &gt;=5.6

v1.5PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/110807de3e60a6610f08a5b88f4718c46f030bcf1ebeef2d67d569b51d7cb4ff?d=identicon)[smalex86](/maintainers/smalex86)

---

Top Contributors

[![smalex86](https://avatars.githubusercontent.com/u/30802869?v=4)](https://github.com/smalex86 "smalex86 (33 commits)")

---

Tags

loggerphppsr-loggerinterfacelogger

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/smalex86-logger/health.svg)](https://phpackages.com/packages/smalex86-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)[ytake/laravel-aspect

Aspect Oriented Programming library for laravel framework, and lumen

138132.2k1](/packages/ytake-laravel-aspect)[bref/logger

All you need to log with Bref on AWS Lambda

331.5M8](/packages/bref-logger)

PHPackages © 2026

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