jeffersongoncalves/laravel-telegram-logger
A Laravel package that adds a Telegram logging channel, sending application logs directly to Telegram chats via a bot. Configure the bot token, chat ID, and log level to receive real-time notifications and monitor errors, warnings, and other events from your Laravel app.
occurred N× roll-up, error grouping by message/level+message/exception/callback, global + per-error rate limiting), this can ship in a sprint rather than a quarter. That makes "we have production error alerting" achievable before investing in full observability tooling.@username mentions, and silent levels for noisy-but-not-urgent events let you segment signal from noise deliberately — a product decision about who gets woken up, not just a logging decision.stacktrace.txt attachment (replying to the message) keeps full fidelity available without blowing past Telegram's 4096-character message cap — a real constraint that shapes whether you enable this on high-stack-depth frameworks.telegram-logger:test [--exception] command is the difference between "we think it's wired up" and a five-second smoke test in your runbook.laravel-discord-logger (same production pipeline, different transport) is a signal that the maintainer is building a family of channels rather than one-offs — relevant if you're deciding whether to standardize alerting across several Laravel services.Strong fit when:
retry_after, 4xx fail-fast with Telegram's own description forwarded to a fallback channel. That failure taxonomy is unusually thought-through for a v1.Look elsewhere when:
laravel-discord-logger is the obvious alternative; Slack and email channels are well-trodden in Laravel's ecosystem.occurred N× roll-up to reconstruct what happened, and Telegram's per-chat limits become the ceiling. Structured log storage should be the primary system; this should be the pager.Adoption checklist before you commit: confirm PHP/Laravel version floors across services; confirm who owns the bot token and chat/topic IDs as secrets; decide the level→chat matrix and which levels are silent; decide whether @username mentions are acceptable (they're effective and they're also a good way to annoy people); verify redaction patterns against a sample of real exception payloads; run telegram-logger:test --exception in staging, not production.
To executives: We can have production error alerting landing in a channel the team already monitors, this sprint, at no licence cost. It's a single Laravel package with sensible defaults — it de-duplicates repeated errors, groups related ones, and rate-limits itself so the channel stays readable rather than becoming noise people mute. It handles the unglamorous reliability work (queued delivery, retry with backoff, graceful handling of API failures) that we would otherwise build and maintain ourselves. It's a targeted improvement to how fast we notice and respond to incidents, not a replacement for our observability spend — think of it as closing the gap on the environments and services that don't justify a paid APM contract.
To engineering: Drop-in Laravel log channel over the Telegram Bot API, async via queued job. Retries on 5xx/unreachable with backoff, honours retry_after on 429, fails fast on 4xx and reports Telegram's description to a fallback channel. HTML messages with Exception/Request/Livewire/Job/Command/Stacktrace/Context/Extra sections, clamped to 4096 chars, with the full stacktrace attached as stacktrace.txt replying to the message. Dedup with occurred N× roll-up, error grouping by message, level+message, exception, or callback, plus global (default 20/min) and per-error rate limits. Per-level chats and forum topics, @username mentions, disable_notification for low-priority levels. Key and value-pattern redaction with bot tokens always masked. No-ops cleanly when token or chat id is absent, so local/CI need no special-casing. Smoke test: php artisan telegram-logger:test --exception.
To security/compliance: Payloads are scrubbed before they leave the process via configurable key and value-pattern redaction, and bot tokens are masked unconditionally. Data goes to Telegram, so the open question is policy, not implementation — that needs a yes/no before rollout, and it's the one item that can block the whole thing.
Caveats to state up front, not later: this is a 1.0.0 first release with no track record; PHP 8.2+ and Laravel 12.61+/13 are hard requirements; single-maintainer risk means we should be comfortable forking if it stalls; and it is a notification pipe, not a log store — we keep our existing logging and treat this as the alerting layer on top.
How can I help you explore Laravel packages today?