Download the PHP package mrjavadseydi/telegram-logging without Composer
On this page you can find all versions of the php package mrjavadseydi/telegram-logging. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mrjavadseydi/telegram-logging
More information about mrjavadseydi/telegram-logging
Files in mrjavadseydi/telegram-logging
Package telegram-logging
Short Description Send logs to Telegram chat via Telegram bot
License MIT
Informations about the package telegram-logging
Laravel Telegram logger
Send logs to Telegram chat via Telegram bot
Install
Define Telegram Bot Token and chat id (users telegram id) and set as environment parameters. Add to .env
Add to config/logging.php file new channel:
If your default log channel is a stack, you can add it to the stack channel like this
Or you can simply change the default log channel in the .env
Publish config file and views
Telegram Logging Formats
You can choose among two different formats that you can specify in the .env
file like this :
It is possible to create other blade templates and reference them in the TELEGRAM_LOGGER_TEMPLATE
entry
Create bot
For using this package you need to create Telegram bot
- Go to @BotFather in the Telegram
- Send
/newbot
- Set up name and bot-name for your bot.
- Get token and add it to your .env file (it is written above)
- Go to your bot and send
/start
message
Change log template at runtime
-
Change config for template.
- Use
Log
as usual.
Configuring a different chat id or token per channel
-
Add
chat_id
ortoken
to channels inconfig/logging.php
. Overridesconfig('telegram.chat_id')
. - Use
Log
as usual.Lumen support
To make it work with Lumen, you need also run two steps:
-
Place config/telegram-logger.php file with following code:
- Uncomment and configure the file at bootstrap/app.php
- Place default Laravel/Lumen logging file to config/logging.php (to add new channel).
All versions of telegram-logging with dependencies
monolog/monolog Version ^1.23|^2.0
illuminate/support Version ^5.5 || ^6.0 || ^7.0 || ^8.0