Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Telegram Log Channel

Telegram Log Channel Laravel Package

arhx/telegram-log-channel

Laravel log channel that sends Monolog messages to a Telegram chat via bot token and chat ID. Configure via .env or logging.php, add to your logging stack, and it safely falls back to a NullHandler when unset. Includes optional queued job failure alerts.

View on GitHub
Deep Wiki
Context7

A simple Laravel package to send log messages to a Telegram chat.

Frequently asked questions about Telegram Log Channel
How do I install arhx/telegram-log-channel in Laravel?
Run `composer require arhx/telegram-log-channel` to install. The package auto-registers its service provider, so no additional steps are needed beyond configuration.
What Laravel versions does this package support?
The package works with Laravel 10, 11, and 12. It requires PHP 8.0+. Older versions (e.g., Laravel 8/9) may need adjustments due to API changes.
How do I configure the Telegram log channel?
Add `TELEGRAM_LOG_BOT_TOKEN` and `TELEGRAM_LOG_CHAT_ID` to your `.env`, then include `'telegram'` in your `config/logging.php` stack. Example: `'channels' => ['daily', 'telegram']` for the default stack.
What happens if my Telegram bot token or chat ID is missing?
The package gracefully falls back to a `NullHandler`, meaning no logs are sent to Telegram, and your app won’t crash. This ensures zero downtime if credentials are misconfigured.
Can I filter log levels (e.g., only send ERROR or CRITICAL logs)?
Yes. Set `TELEGRAM_LOG_LEVEL` in your `.env` (e.g., `TELEGRAM_LOG_LEVEL=error`) or configure it in `config/logging.php` under the `telegram` channel. Defaults to `error` if unspecified.
Does this package support automatic queue job failure alerts?
Yes, it includes built-in queue job failure notifications. Enable or disable via `TELEGRAM_LOG_QUEUE_FAILURES` in `.env` (enabled by default). Each alert includes job class, exception, and queue connection details.
Will this package work in production without issues?
Yes, but monitor Telegram API rate limits if sending high-volume logs. Use `throw: true` in config to force errors if Telegram’s API fails, or rely on graceful fallback (default). Test in staging first.
How do I customize the Telegram message format for logs?
Extend the package by creating a custom Monolog processor or service provider. Override the default formatter in `config/logging.php` or use Laravel’s Monolog processors to modify log messages before they’re sent.
Are there alternatives to this package for Telegram logging?
Yes. Consider `spatie/laravel-telegram-channel` (similar functionality) or other alert channels like Slack (`spatie/laravel-slack-notification`) or PagerDuty. Choose based on your team’s preferred tooling.
How do I test this package locally before deploying to production?
Start by logging debug messages locally (`Log::debug('Test')`) and verify they appear in your Telegram chat. Use `TELEGRAM_LOG_LEVEL=debug` in `.env` for testing. Disable queue failure alerts (`TELEGRAM_LOG_QUEUE_FAILURES=false`) if not needed.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope