LaravelPackages.net
Acme Inc.
Toggle sidebar
integready/laravel-telegram-logging

Send logs to Telegram chat via Telegram bot

12
0
2.0.0
About integready/laravel-telegram-logging

integready/laravel-telegram-logging is a Laravel package for send logs to telegram chat via telegram bot. It currently has 0 GitHub stars and 12 downloads on Packagist (latest version 2.0.0). Install it with composer require integready/laravel-telegram-logging. Discover more Laravel packages by integready or browse all Laravel packages to compare alternatives.

Last updated

Laravel Telegram logger

Send logs to Telegram chat via Telegram bot

Install


composer require integready/laravel-telegram-logging

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

TELEGRAM_LOGGER_BOT_TOKEN=id:token
TELEGRAM_LOGGER_CHAT_ID=chat_id

Add to config/logging.php file new channel:

'telegram' => [
    'driver' => 'custom',
    'via'    => Logger\TelegramLogger::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', 'telegram'],
]

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

LOG_CHANNEL=telegram

Publish config file

php artisan vendor:publish --provider "Logger\TelegramLoggerServiceProvider"

Create bot

For using this package you need to create Telegram bot

  1. Go to @BotFather in the Telegram
  2. Send /newbot
  3. Set up name and bot-name for your bot.
  4. Get token and add it to your .env file (it is written above)
  5. Go to your bot and send /start message

Star History Chart