underwear/laravel-myteam-logging

Send logs to MyTeam chat via MyTeam bot

v1.1 2020-07-21 13:22 UTC

README

Send logs to Myteam chat via Myteam bot

Install

composer require underwear/laravel-myteam-logging

Define Myteam Bot Token and chat id (users myteam id) and set as environment parameters. Add to .env

MYTEAM_LOGGER_BOT_TOKEN=id:token
MYTEAM_LOGGER_CHAT_ID=chat_id
MYTEAM_LOGGER_API_HOST=https://myteam.mail.ru/

Add to config/logging.php file new channel:

'myteam' => [
    'driver' => 'custom',
    'via'    => MyteamLogger\MyteamLogger::class,
    'level'  => 'debug',
]

If your default log channel is a stack, you can add it to the stack channel like this

'stack' => [
    'driver' => 'stack',
    'channels' => ['single', 'myteam'],
]

Or you can simply change the default log channel in the .env

LOG_CHANNEL=myteam

Publish config file

php artisan vendor:publish --provider "MyteamLogger\MyteamLoggerServiceProvider"

Create bot

For using this package you need to create Myteam bot

See the official docs Myteam BOT API Docs

Credits