senthilhep / hep-laravel-mattermost-chat-log
Brings up the option for sending the logs to mattermost chat.
Requires
- php: ^7.3|^8.0
Requires (Dev)
- guzzlehttp/guzzle: ^5.3.3|^6.2.1|^7.0
- illuminate/support: ^7.0|^8.0|^9.0|^10.0
- monolog/monolog: ^2.0|^3.0
This package is auto-updated.
Last update: 2025-03-10 04:12:38 UTC
README
♥ Made with <love/> And I love <code/>
Laravel/Lumen Mattermost Chat Log
Brings up the option for sending the logs to Mattermost chat from Laravel/Lumen.
Installation
Composer install
composer require senthilhep/hep-laravel-mattermost-chat-log
Add the following code to the channels array in config/logging.php
in your laravel/lumen application.
In Laravel, error codes are categorized by levels:
Info = 200;
Notice = 250;
Warning = 300;
Error = 400;
Critical = 500;
Alert = 550;
Emergency = 600;
Errors reported with a level greater than the configured setting will be logged accordingly.
'mattermost-chat' => [
'driver' => 'monolog',
'url' => env('LOG_MATTERMOST_CHAT_WEBHOOK_URL', ''),
'error_level' => env('LOG_MATTERMOST_ERROR_LEVEL' , 400),
'timezone' => env('LOG_MATTERMOST_CHAT_TIMEZONE' , 'Asia/Kolkata'),
'handler' => \Enigma\MattermostChatHandler::class,
],
You can provide the eight logging levels defined in the RFC 5424 specification: emergency
, alert
, critical
, error
, warning
, notice
, info
, and debug
Note*: Make sure to set the LOG_MATTERMOST_CHAT_WEBHOOK_URL env variable.
In order to notify different users for different log levels, you can set the corresponding env keys mentioned to configure in the logging.php
file.
License
Copyright © Senthil Prabu
Laravel Mattermost Chat Log is open-sourced software licensed under the MIT license.