Search by

patrickfischer / monolog-ntfy-safe

zero0cool0

A non fatal version of a Monolog handler for ntfy.sh

Package info

github.com/zero0cool0/patrickfischer-monolog-ntfy-safe

pkg:composer/patrickfischer/monolog-ntfy-safe

Statistics

Installs: 21

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.2 2026-10-30 10:05 UTC

This package is auto-updated.

Last update: 2026-10-30 10:05:28 UTC


README

A non fatal Monolog handler for ntfy.sh which does not throw on curl error, but uses error_log() as a final fallback.

Installation

Install it with composer:

composer require patrickfischer/monolog-ntfy-safe

Update config/logging.php to use the handler like so:

use PatrickFischer\Monolog\SafeNtfyWebhookHandler;

return [
    // other configuration

    'channels' => [
        // other channels

        'ntfy' => [
            'driver'  => 'monolog',
            'handler' => SafeNtfyWebhookHandler::class,
            'with' => [
                'url' => env('LOG:_NTFY_URL'),
                // Optional access token
                'access_token' => env('LOG_NTFY_TOKEN'),
                // Implement a hard to guess topic
                'topic' => sha1('Laravel'),
                'title' => env('LOG_NTFY_TITLE'),
                'level' => env('LOG_NTFY_LEVEL', 'error'),
                'timeout_ms' => 1000,
                'tags' => 'warning,php',
                'bubble' => true,
            ],
        ],
    ]
];

License

MIT