Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 2.23 KB

README.md

File metadata and controls

51 lines (34 loc) · 2.23 KB

monolog-rocketchat-handler

Scrutinizer Code Quality Code Intelligence Status

License Latest Stable Version Latest Unstable Version composer.lock Total Downloads

Installation

composer require martinusso/monolog-rocketchat-handler

Usage

Push this handler to your Monolog instance:

$webhook = 'https://rocket.chat.local/hooks/bd97pizfGu3S5q5oT/SmCgGWSc4vEuRyBu5eocnBDDKvZvoqL6whRKpvsBK2TjvNk2';

$rocketChatHandler = new RocketChatHandler\RocketChatHandler([$webhook], Monolog\Logger::DEBUG);

$monolog = new Monolog\Logger('Rocket.Chat');
$monolog->pushHandler($rocketChatHandler);

Supports multiple webhook URLs:

$rocketChatHandler = new RocketChatHandler\RocketChatHandler(
    [
        'https://rocket.chat.local/hooks/bd97pizfGu3S5q5oT/SmCgGWSc4vEuRyBu5eocnBDDKvZvoqL6whRKpvsBK2TjvNk2',
        'https://rocket.chat.server/hooks/bd97pizfGu3S5q5oT/SmCgGWSc4vEuRyBu5eocnBDDKvZvoqL6whRKpvsBK2TjvNk2',
        // ...
    ],
    Monolog\Logger::DEBUG
);

// ...

License

This software is open source, licensed under the The MIT License (MIT). See LICENSE for details.