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

Telegram log channel for Laravel

Frequently asked questions about Telegram Log Channel
How do I install and set up arhx/telegram-log-channel in Laravel?
Run `composer require arhx/telegram-log-channel`, then add `TELEGRAM_LOG_BOT_TOKEN` and `TELEGRAM_LOG_CHAT_ID` to your `.env`. No service provider registration is needed—it auto-registers. Configure the channel in `config/logging.php` under your stack (e.g., `channels => ['daily', 'telegram']`).
Which Laravel versions and PHP versions does this package support?
The package supports Laravel 8 through 12 and PHP 8.0+. It’s fully backward-compatible with existing logging configurations, so no breaking changes exist for upgrades within these ranges.
Can I filter logs by level (e.g., only send errors to Telegram)?
Yes. Set `TELEGRAM_LOG_LEVEL` in your `.env` (e.g., `TELEGRAM_LOG_LEVEL=error`) or override it in `config/logging.php`. By default, it logs `error` and above, but you can adjust it to `debug` for all logs or `critical` for emergencies.
What happens if my Telegram bot token or chat ID is missing in .env?
The channel gracefully falls back to a `NullHandler`, meaning no logs are sent to Telegram, and your application continues running without errors. This prevents crashes during misconfigurations.
Does this package support job failure notifications for Laravel queues?
Yes. It automatically integrates with Laravel’s `Queue::failing` listener, sending failed job details to Telegram without extra setup. This is ideal for debugging async tasks like email queues or payment processing.
How do I handle Telegram’s 4096-character message limit for stack traces?
Use Laravel’s `Log::stack()` with a custom Monolog processor to split long logs into multiple messages. The package itself doesn’t truncate logs, but you can pre-process them with a `Log::replace()` or `Log::pushProcessor()` to break them into chunks.
Can I throttle duplicate logs to avoid spam in my Telegram chat?
Yes. Set `TELEGRAM_LOG_THROTTLE` in your `.env` (e.g., `TELEGRAM_LOG_THROTTLE=600` for 10 minutes). Identical messages—based on level, text, and source—are suppressed during this window. Disable throttling by setting it to `0`.
Is there a risk of hitting Telegram’s API rate limits (30 messages/second)?
Yes. For high-volume logs (>10 messages/second), implement rate limiting in your Monolog processor (e.g., `sleep()` between batches). The package doesn’t enforce this by default, but you can extend it or use Laravel’s queue system to batch logs.
How do I customize the Telegram log channel beyond basic token/chat ID?
Publish the config file with `php artisan vendor:publish --tag=telegram-log-channel-config`, then edit `config/telegram-log-channel.php`. You can override settings like `throw` (to log API errors), `url` (custom Telegram API endpoint), or `formatter` (customize log formatting).
What are the alternatives to arhx/telegram-log-channel for Laravel logging?
Alternatives include Slack/Discord webhook channels (e.g., `spatie/laravel-slack-notifier`), Pusher/Laravel Echo for real-time alerts, or dedicated monitoring tools like Sentry. Telegram is lightweight and free for most use cases, but Slack offers better team collaboration features.
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.
nexmo/api-specification
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes