PHPackages                             projek-xyz/slim-monolog - 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. [Framework](/categories/framework)
4. /
5. projek-xyz/slim-monolog

AbandonedArchivedLibrary[Framework](/categories/framework)

projek-xyz/slim-monolog
=======================

Write log file on your Slim 3 application with Monolog logger.

v0.1.6(9y ago)1117.1k↑63.6%11MITPHPPHP &gt;=5.5.0

Since Nov 5Pushed 6y ago1 watchersCompare

[ Source](https://github.com/projek-xyz/slim-monolog)[ Packagist](https://packagist.org/packages/projek-xyz/slim-monolog)[ Docs](http://www.projek.xyz/slim-monolog)[ RSS](/packages/projek-xyz-slim-monolog/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (7)Dependencies (4)Versions (9)Used By (1)

Monolog Logger Integration for Slim micro framework 3
=====================================================

[](#monolog-logger-integration-for-slim-micro-framework-3)

[![LICENSE](https://camo.githubusercontent.com/376d7a77319e0d277cb8bcf898e1db6dd6e52851646248959e426b8962a02f2a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f70726f6a656b2d78797a2f736c696d2d6d6f6e6f6c6f672e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![VERSION](https://camo.githubusercontent.com/070d6201b72ba3bbd58d107a858b0c068566b9fed33b5c98313261928ee9a699/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70726f6a656b2d78797a2f736c696d2d6d6f6e6f6c6f672e7376673f7374796c653d666c61742d737175617265)](https://github.com/projek-xyz/slim-monolog/releases)[![Build Status](https://camo.githubusercontent.com/c33b08e3f56d3db4b98531bd83f63e995fe91260bb0a02016378ad7f2dba7ad9/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f70726f6a656b2d78797a2f736c696d2d6d6f6e6f6c6f672f6d61737465722e7376673f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://travis-ci.org/projek-xyz/slim-monolog)[![Coveralls](https://camo.githubusercontent.com/1a55610c9cdc2c1254bb1adf3885181b897a98cb3a2d4c857a8675ab01c496d5/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f70726f6a656b2d78797a2f736c696d2d6d6f6e6f6c6f672f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/projek-xyz/slim-monolog)[![Code Climate](https://camo.githubusercontent.com/1238da27e1a156b8479434b630e5e0337604a88526ba2b7cc9c53508b4f74176/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f636f7665726167652f6769746875622f70726f6a656b2d78797a2f736c696d2d6d6f6e6f6c6f672e7376673f7374796c653d666c61742d737175617265)](https://codeclimate.com/github/projek-xyz/slim-monolog/coverage)[![Code Climate](https://camo.githubusercontent.com/cb8632bcf181eba451053fff5c62326bd18c09b5a69ed6651e140eaba1d52621/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f70726f6a656b2d78797a2f736c696d2d6d6f6e6f6c6f672e7376673f7374796c653d666c61742d737175617265)](https://codeclimate.com/github/projek-xyz/slim-monolog)[![SensioLabs Insight](https://camo.githubusercontent.com/cdf6634a8a9d01da2949222dc958d22313bab7b11d1059d9268f40d76ac7efe6/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f32363331366335312d323633372d343733662d383162622d3137616633363166346236352e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/26316c51-2637-473f-81bb-17af361f4b65)

Write log file on your Slim 3 application with Monolog logger.

Install
-------

[](#install)

Via [Composer](https://getcomposer.org/)

```
$ composer require projek-xyz/slim-monolog --prefer-dist
```

Requires Slim micro framework 3 and PHP 5.5.0 or newer.

Usage
-----

[](#usage)

```
// Create Slim app
$app = new \Slim\App();

// Fetch DI Container
$container = $app->getContainer();

// Register Monolog helper:
// Option 1, using MonologProvider
$container->register(new \Projek\Slim\MonologProvider);

// Option 2, using Closure
$container['logger'] = function ($c) {
    $settings = [
        // Path to log directory
        'directory' => 'path/to/logs',
        // Log file name
        'filename' => 'my-app.log',
        // Your timezone
        'timezone' => 'Asia/Jakarta',
        // Log level
        'level' => 'debug',
        // List of Monolog Handlers you wanna use
        'handlers' => [],
    ];

    return new \Projek\Slim\Monolog('slim-app', $settings);
};

// Define a log middleware
$app->add(function ($req, $res, $next) {
    $return = $next($req, $res);

    $this->logger->info('Something happen');

    return $return;
});

// Run app
$app->run();
```

**NOTE**:

- If you are using *option 1* please make sure you already have `$container['settings']['logger']` in your configuration file.
- `$settings['filename']` only required if you have `$settings['directory']`
- Set `$settings['directory']` to `syslog` to use System Log.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) and [CONDUCT](.github/CONDUCT.md) for details.

License
-------

[](#license)

This library is open-sourced software licensed under [MIT license](LICENSE.md).

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

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

Recently: every ~84 days

Total

7

Last Release

3547d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/16384dbbd6cd66f33f13f5bf2dc7f26125049762c7414eb0e755c630375240ba?d=identicon)[feryardiant](/maintainers/feryardiant)

---

Top Contributors

[![feryardiant](https://avatars.githubusercontent.com/u/508665?v=4)](https://github.com/feryardiant "feryardiant (58 commits)")

---

Tags

frameworkslimloggermonolog

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/projek-xyz-slim-monolog/health.svg)

```
[![Health](https://phpackages.com/badges/projek-xyz-slim-monolog/health.svg)](https://phpackages.com/packages/projek-xyz-slim-monolog)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.4k](/packages/laravel-framework)[duxweb/dux-lite

The lightweight framework based on slim php

161.0k9](/packages/duxweb-dux-lite)

PHPackages © 2026

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