senthilhep/hep-laravel-slack-chat-log

Brings up the option for sending the logs to slack chat.
4,997
Install
composer require senthilhep/hep-laravel-slack-chat-log
PHP:^7.3|^8.0
License:MIT
Last Updated:Sep 24, 2024
Links: GitHub  ·  Packagist
Maintainer: senthilhep

Laravel/Lumen Slack Chat Log

Brings up the option for sending the logs to Slack chat from Laravel/Lumen.

Installation

Composer install

composer require senthilhep/hep-laravel-slack-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.
'slack-chat' => [
    'driver' => 'monolog',
    'url' => env('LOG_SLACK_CHAT_WEBHOOK_URL'),
    'error_level' => env('LOG_SLACK_ERROR_LEVEL' , 400),
    'timezone' => env('LOG_SLACK_CHAT_TIMEZONE' , 'Asia/Kolkata'),
    'handler' => \Enigma\SlackChatHandler::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_SLACK_CHAT_WEBHOOK_URL env variable.

Here, you can set multiple slack chat webhook url as comma separated value for the LOG_SLACK_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 Slack Chat Log is open-sourced software licensed under the MIT license.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

631,580,251 9,707
laravel/framework

The Laravel Framework.

580,311,802 34,925
laravel/tinker

Powerful REPL for the Laravel framework.

489,754,436 7,444
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

404,034,618 608
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

387,976,821 4,658