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

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

mattmezza/logger
================

Lightweight package for logging purposes.

1.0.0(7y ago)243MITPHPPHP ^7.0

Since Feb 11Pushed 7y ago2 watchersCompare

[ Source](https://github.com/mattmezza/php-logger)[ Packagist](https://packagist.org/packages/mattmezza/logger)[ RSS](/packages/mattmezza-logger/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

php-logger
==========

[](#php-logger)

[![Travis (.org)](https://camo.githubusercontent.com/834be7ea035d5c0b516f2871693d0f91e203079b748d16c958b96f0c0a2610a5/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d6174746d657a7a612f7068702d6c6f676765722e737667)](https://github.com/mattmezza/php-logger)

This package is a small utility for logging purposes. It allows you to quickly set up a logging system.

Usage
-----

[](#usage)

The main component to use is `LevelLogger`. Just create a new instance and start logging.

```
$log = new LevelLogger();

$log->info('DONE.');
$log->debug('I\'m here.');
$log->error($exception->getMessage());
```

There are `3` levels namely `info|debug|error` that come handy when switching environment `development|staging|production`.

The package comes with `3` logging strategies namely:

- `STDOUT` (default): it just `echo` the message (together with a timestamp and the log level)
- `SYSLOG`: calls the `syslog(...)` function and logs the message (using the syslog format) to the system log
- `FILE`: appends the log message (together with the timestamp and log level) to a file that you specify

#### How do you specify the parameters?

[](#how-do-you-specify-the-parameters)

The package reads from `ENV` variables. The following variables are used:

- `LOG_LEVEL`: can be either `INFO|DEBUG|ERROR` and defaults to `ERROR` to be the least verbose. When the log level is `ERROR` all the `info` and `debug` messages will not be logged. When the log level is set to `DEBUG`, all the `info` messages will not be logged. When set to `INFO` instead, all of the messages will be logged;
- `LOG_STRATEGY`: can be either `STDOUT|SYSLOG|FILE` and defaults to `SYSLOG`. It sets the strategy. When the `FILE` strategy is chosen, please specify the file path by using the next described variable;
- `LOG_FILE_PATH`: must be a writable file path. It defaults to `/var/log/logger.log`;

Development
-----------

[](#development)

You can add new loggers by implementing the `Logger` interface.

Further development
-------------------

[](#further-development)

- Would be nice to add a file rotate feature when logging to file.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

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

Unknown

Total

1

Last Release

2643d ago

### Community

Maintainers

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

---

Top Contributors

[![mattmezza](https://avatars.githubusercontent.com/u/1915989?v=4)](https://github.com/mattmezza "mattmezza (2 commits)")

---

Tags

debugerrorinfokisslogloggingstdoutsyslog

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.1k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M93](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M136](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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