mumsnet/mn-monolog

Custom handlers for Monolog

Installs: 5 651

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 8

Forks: 0

Open Issues: 0

pkg:composer/mumsnet/mn-monolog

v1.0.4 2020-08-07 09:04 UTC

This package is auto-updated.

Last update: 2025-09-07 21:00:16 UTC


README

Custom handlers for Monolog

How to use with Lumen

Add this to your composer.json file in the require section:

"mumsnet/mn-monolog": "^1.0"

Run composer to update the packages:

docker run -it -v `pwd`:/var/www/html mumsnet/php-fpm-lumen:7.3 composer install

Add this to your bootstrap/app.php file:

if (getenv('PAPERTRAIL_HOSTNAME') !== FALSE) {
    $app->configureMonologUsing(function ($monolog) {
        $papertrailHandler = new PapertrailHandler(
            getenv('PAPERTRAIL_HOSTNAME'),
            getenv('PAPERTRAIL_PORT'),
            getenv('SITE_HOSTNAME'),
            getenv('PAPERTRAIL_PROGRAM_NAME'));
        $monolog->pushHandler($papertrailHandler);
        return $monolog;
    });
}