PHPackages                             vrza/simplogger - 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. vrza/simplogger

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

vrza/simplogger
===============

Lightweight PHP logging library

v1.0.0(2y ago)08.1k↓30.8%11Apache-2.0PHPPHP &gt;=7.1

Since May 10Pushed 2y ago1 watchersCompare

[ Source](https://github.com/vrza/simplogger)[ Packagist](https://packagist.org/packages/vrza/simplogger)[ Docs](https://github.com/vrza/simplogger/)[ RSS](/packages/vrza-simplogger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (6)Used By (1)

Simplogger: Simple PHP logging utility
======================================

[](#simplogger-simple-php-logging-utility)

Overview
--------

[](#overview)

The goal of Simplogger is to provide a logging utility library for PHP that is lightweight, simple to use, and simple to integrate.

Simplogger can log to:

- stdout/stderr
- local syslogd (/dev/log)
- remote syslogd (UDP)
- file

Typical use case is a PHP microservice that uses syslogd for logging when deployed, but can just as easily use stdout/stderr (e.g. in the development environment).

```
use \VladimirVrzic\Simplogger\StdouterrLogger;
use \VladimirVrzic\Simplogger\SyslogLogger;

$ident = basename($argv[0]);
$opts = getopt('s', ['syslog']);
$logger = array_key_exists('s', $opts) || array_key_exists('syslog', $opts)
  ? new SyslogLogger($ident, LOG_CONS, LOG_LOCAL1)
  : new StdoutLogger;
$logger->notice('Hello world!');
```

Setup
-----

[](#setup)

### Installation

[](#installation)

Assuming you have PHP Composer installed, and that the `composer` executable is in your `$PATH`:

```
composer require vrza/simplogger
```

### Log to local syslog

[](#log-to-local-syslog)

```
$ident = 'my-program-name';
$facility = LOG_LOCAL1;
$options = LOG_CONS;
$logger = new SyslogLogger($ident, $options, $facility);
```

`SyslogLogger` logs using PHP’s `syslog()`function. Parameters are the same as passed to `openlog()`.

### Log to remote syslogd via UDP

[](#log-to-remote-syslogd-via-udp)

```
$syslogHost = 192.0.2.22;
$syslogPort = 514;
$logger = new RemoteSysLogger($ident, $facility, $syslogHost, $syslogPort);
```

`RemoteSysLogger` sends all messages to syslogd over UDP. Default host is `127.0.0.1`, default port number is 514.

### Log to stdout/stderr

[](#log-to-stdoutstderr)

```
$logger = new StdoutLogger;
```

`StdoutLogger` writes all messages to stdout.

`StderrLogger` writes all messages to stderr.

`StdouterrLogger` writes WARNING and higher severity messages to stderr, writes other messages to stdout.

These loggers can be optionally set up to include timestamp, ident and severity with each message:

```
$timestamp = TRUE;
$severity = TRUE;
$logger = new StdoutLogger($timestamp, $severity, $ident);
```

### Log to file

[](#log-to-file)

```
$logFile = '/var/log/my.log';
$logger = new FileLogger($logFile);
```

`FileLogger` writes all messages to a given file.

Like the stdout/stderr loggers, `FileLogger` has an option to include timestamp, ident and severity with each message.

```
$logger = new FileLogger($logFile, $timestamp, $severity, $ident);
```

Usage
-----

[](#usage)

```
$logger->alert('A message with ALERT severity');
$logger->crit('A message with CRIT severity');
$logger->err('A message with ERR severity');
$logger->warning('A message with WARNING severity');
$logger->notice('A message with NOTICE severity');
$logger->info('A message with INFO severity');
$logger->debug('A messsage with DEBUG severity');
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

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

Total

3

Last Release

817d ago

Major Versions

v0.9.1 → v1.0.02024-02-21

PHP version history (2 changes)v0.9PHP ^7.0 || ^8.0

v0.9.1PHP &gt;=7.1

### Community

Maintainers

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

---

Top Contributors

[![vrza](https://avatars.githubusercontent.com/u/1699472?v=4)](https://github.com/vrza "vrza (42 commits)")

---

Tags

libraryloggingphploglogging

### Embed Badge

![Health badge](/badges/vrza-simplogger/health.svg)

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

###  Alternatives

[monolog/monolog

Sends your logs to files, sockets, inboxes, databases and various web services

21.4k964.9M7.0k](/packages/monolog-monolog)[symfony/monolog-bundle

Symfony MonologBundle

2.9k249.1M1.6k](/packages/symfony-monolog-bundle)[sentry/sentry

PHP SDK for Sentry (http://sentry.io)

1.9k227.1M273](/packages/sentry-sentry)[sentry/sentry-laravel

Laravel SDK for Sentry (https://sentry.io)

1.3k114.3M154](/packages/sentry-sentry-laravel)[rap2hpoutre/laravel-log-viewer

A Laravel log reader

3.2k14.7M71](/packages/rap2hpoutre-laravel-log-viewer)[sentry/sdk

This is a meta package of sentry/sentry. We recommend using sentry/sentry directly.

328134.8M151](/packages/sentry-sdk)

PHPackages © 2026

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