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

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

cymapgt/logger
==============

Wrapper for Monolog. Provides custom log levels with customized Handlers based on log level

3.0.1(6y ago)167[1 PRs](https://github.com/cymapgt/logger/pulls)1BSD-3-ClausePHPPHP &gt;=7.2.0

Since May 21Pushed 5y ago1 watchersCompare

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

READMEChangelogDependencies (4)Versions (14)Used By (1)

logger
======

[](#logger)

Wrapper for Monolog library. Implements custom log levels out of the box. Based on the log importance, custom logger levels allow logging to file, email, sms or a combination of either /all

Description
-----------

[](#description)

The logger package stands on the shoulders of giants; Monolog library is PHP's de facto logger which supports multiple channels, as well as building of custom channels, as has been done with the SmsChannel of the cymapgt logger. As such, most of the logger implementation is dedicated to configuration, with the heavy logging work being delegated to the elegant Monolog.

Installing
----------

[](#installing)

### Install application via Composer

[](#install-application-via-composer)

```
require "cymapgt/logger" : "^1.0.0"

```

Usage
-----

[](#usage)

### Overview

[](#overview)

The logger package implements the following Logger strategy:

-Stderr Logger: This can be loaded in order to provide Stream Logging capability for CLI applications

-Logger Level1: This application will provide basic logging services to just the default destination. The default destination for this logger is usually either a file or a database. As such, the log directory will have to be provided. Another option is database, but this is not implemented for now.

-Logger Level 2: This will still provide logging services to the log file as well as to email. It is utilized for log items that need more immediate attention.

-Logger Level 3: This will provide logging services to the log file, to email as well as to SMS. The idea behind the strategy is to enable graceful escalation in the event that an application may need to provide a more responsive log message by gradually choosing which log level to use.

-Logger Security: The security logger will provide security related logs to a separate secure file

-Logger Alert: This is still in design, and is an escalated level of the Logger Security class

### Using the Logger package

[](#using-the-logger-package)

#### Named Constants

[](#named-constants)

```
//Log levels for Logger Class
if (!(defined('LOGGER_STDERR'))) {
    define('LOGGER_STDERR', 0);
}

if (!(defined('LOGGER_LEVEL1'))) {
    define('LOGGER_LEVEL1', 1);
}

if (!(defined('LOGGER_LEVEL2'))) {
    define('LOGGER_LEVEL2', 2);
}

if (!(defined('LOGGER_LEVEL3'))) {
    define('LOGGER_LEVEL3', 3);
}

if (!(defined('LOGGER_SECURITY'))) {
    define('LOGGER_SECURITY', 4);
}

```

#### Bootstraping the Logger

[](#bootstraping-the-logger)

You need to have the bootstrap package, which you will use to set up the \[logger\] group configurations for this package in the file cymapgt.network.ini; for example.

See cymapgt/bootstrap documentation for how to run this configuration.

```
[logger]
logger_file_location = '/var/www/html/logger_test.txt'
logger_security_file_location = '/var/www/html/logger_security.txt'
logger_email_alert_administrators = '{"cogana@gmail.com": "Cyril Ogana"}'
logger_sms_alert_administrators = '254123456789'
logger_email_alert_subject = 'SYSTEM IMPORTANT LOG MESSAGE ALERT'
logger_email_security_alert_administrators = '{"cogana@gmail.com": "Cyril Ogana"}'
logger_sms_security_alert_administrators = '254123456789'
logger_email_security_alert_subject = 'SYSTEM IMPORTANT LOG MESSAGE ALERT'

```

#### Logging Example

[](#logging-example)

```
use cymapgt\core\utility\bootstrap\Bootstrap;
use cymapgt\core\utility\logger\Logger;

$loggerDbError = Logger::getLogger(\LOGGER_SECURITY, Bootstrap::LoggerSecurityParams());
$loggerDbError->addError('Critical error, the core database is down'); //log to file, email and sms

```

### Testing

[](#testing)

PHPUnit Tests are provided with the package

### Contribute

[](#contribute)

- Email @rhossis or contact via Skype
- You will be added as author for contributions

### License

[](#license)

BSD 3-clause

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 58.8% 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 ~158 days

Recently: every ~112 days

Total

11

Last Release

2463d ago

Major Versions

1.0.4 → 2.0.02018-04-23

2.0.5 → 3.0.02019-09-25

PHP version history (2 changes)2.0.1PHP &gt;=7.0.0

3.0.1PHP &gt;=7.2.0

### Community

Maintainers

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

---

Top Contributors

[![cymapgt](https://avatars.githubusercontent.com/u/12482626?v=4)](https://github.com/cymapgt "cymapgt (10 commits)")[![rhossis](https://avatars.githubusercontent.com/u/7324938?v=4)](https://github.com/rhossis "rhossis (7 commits)")

---

Tags

Monolog Wrapper

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[symfony/monolog-bridge

Provides integration for Monolog with various Symfony components

2.6k198.8M328](/packages/symfony-monolog-bridge)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[spatie/flare-client-php

Send PHP errors to Flare

177156.9M21](/packages/spatie-flare-client-php)[illuminate/log

The Illuminate Log package.

6225.0M601](/packages/illuminate-log)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[grkamil/laravel-telegram-logging

Send logs to Telegram chat via Telegram bot

161493.0k](/packages/grkamil-laravel-telegram-logging)

PHPackages © 2026

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