Skip to content

martinusso/monolog-rocketchat-handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.