Download the PHP package flashteamdev/laravel-telegram-logging without Composer
On this page you can find all versions of the php package flashteamdev/laravel-telegram-logging. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download flashteamdev/laravel-telegram-logging
More information about flashteamdev/laravel-telegram-logging
Files in flashteamdev/laravel-telegram-logging
Package laravel-telegram-logging
Short Description Send logs to Telegram chat via Telegram bot
License MIT
Informations about the package laravel-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
/startmessage
Change log template at runtime
-
Change config for template.
- Use
Logas usual.
Configuring a different chat id or token per channel
-
Add
chat_idortokento channels inconfig/logging.php. Overridesconfig('telegram.chat_id'). - Use
Logas usual.
Proxy support
To use a proxy server, set the variable in the .env
Exclude logs
To ignore logs containing specific text, add the following to your .env file:
Or you can add them to your config/logging.php channel:
All versions of laravel-telegram-logging with dependencies
monolog/monolog Version ^3.0
laravel/framework Version ^10.0 | ^11.0 | ^12.0 | ^13.0