martinusso / monolog-rocketchat-handler
A Monolog handler for Rocket.Chat webhooks
v1.0.1
2020-10-19 13:15 UTC
Requires
This package is auto-updated.
Last update: 2024-11-19 22:25:00 UTC
README
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.