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.
Architecture fit. The package installs as a Laravel/Monolog logging channel, so it slots into the framework's native config/logging.php channel system rather than requiring application code changes — a handler registered behind the Log facade, configured via published config and env vars. Delivery is decoupled from the request path through a queued job, which is the correct shape: a slow or failing third-party API should never add latency to a web request. The stated lineage (sibling of laravel-discord-logger, "same production pipeline") is a positive signal for architectural consistency — a team already running the Discord logger gets a familiar mental model, config shape, and operational runbook. The feature set is unusually complete for a 1.0.0: dedup with occurred N× roll-up, error grouping strategies, rate limiting, per-level/forum-topic routing, mentions, silent levels, and structured HTML sections all match what a production alerting channel actually needs. The 4096-character clamp with a full stacktrace delivered as a replying stacktrace.txt document is a pragmatic answer to Telegram's message limit.
Integration feasibility. Low effort. Composer install, publish config, set bot token and chat id, smoke-test with php artisan telegram-logger:test [--exception]. The graceful no-op when credentials are absent means the package can be installed into staging and CI without breaking anything before provisioning is complete — a genuinely considerate design choice, though see the failure-mode caveat below.
Technical risk. Five items dominate:
@username mention routing is expected to reach individuals who have never interacted with the bot.Key questions.
Stack fit. PHP 8.2+ and Laravel 12.61+/13 — fine for current-generation applications, excluding older LTS versions. No infrastructure prerequisites beyond a working queue and outbound HTTPS to api.telegram.org. This is an additive channel, not a replacement for existing log drivers, so it composes with whatever file/stderr/APM sinks are already in place.
Migration path. Greenfield addition; no data migration, no schema changes, no application code touched. The realistic path is a parallel-run pilot: add Telegram as a secondary channel for a subset of levels on one service, keep the incumbent alerting untouched, and only consider consolidation after the pilot proves signal quality and delivery reliability.
Compatibility. Composer-resolved, so upgrades are explicit. The external dependency to watch is Telegram's Bot API itself: it is versioned independently of the package, so a Telegram-side change could degrade behaviour without a corresponding package release. Treat that as a standing watch item rather than a one-time check.
Sequencing.
telegram-logger:test and --exception.Maintenance. Small code footprint, but a young package — pin the version and budget for upgrade review each minor. Config is published into the repository, so tuning is under our control. The durable maintenance cost is not the code: it is the redaction ruleset, which will silently rot as new fields appear in log context. Assign a named owner and schedule a periodic review.
Support. Expect GitHub-issues-only upstream support from a single maintainer. Internal support load will concentrate on "why didn't the alert arrive" triage, which requires the runbook to distinguish package, queue, and Telegram failures.
Scaling. The rate limiter caps chat traffic and protects against alert storms — the right default, with the caveat above about which errors survive the cap. Each oversized message costs two API calls (message + document reply), roughly doubling volume and consuming per-chat limits faster, so high-volume services should route to their own chat or topic rather than sharing one. The real scaling lever is queue worker capacity and backlog monitoring, not the package.
Failure modes.
retry_after; correct, at the cost of latency.telegram-logger:test on a schedule.Ramp-up. Under a day for a competent Laravel engineer to install, configure and verify. The meaningful ramp-up is operational: on-call must understand that Telegram is a notification surface and where the authoritative record lives, and someone must own bot provisioning, chat membership and token rotation (tokens are masked in output, but the rotation procedure still needs to be written down before it is needed).
How can I help you explore Laravel packages today?