PHPackages                             uzhlaravel/telegramlogs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. uzhlaravel/telegramlogs

ActiveLibrary

uzhlaravel/telegramlogs
=======================

Monitor your Laravel application logs in real-time through Telegram. This package delivers instant notifications of critical events directly to your Telegram channel, with support for threaded discussions and Markdown formatting.

v0.1.9.2(8mo ago)8721MITPHPPHP ^8.2CI passing

Since Feb 1Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/Uzziahlukeka/telegrammonitor)[ Packagist](https://packagist.org/packages/uzhlaravel/telegramlogs)[ Docs](https://github.com/Uzziahlukeka/telegrammonitor)[ GitHub Sponsors](https://github.com/uzhlaravel)[ RSS](/packages/uzhlaravel-telegramlogs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (13)Used By (0)

Telegram Logs Monitor for Laravel
=================================

[](#telegram-logs-monitor-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2321abf4ff78f299917d86bced0f4beceb4c5e2a511b586b9b738ff1b5febec1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f757a686c61726176656c2f74656c656772616d6c6f67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/uzhlaravel/telegramlogs)[![GitHub Tests Action Status](https://github.com/Uzziahlukeka/telegrammonitor/actions/workflows/run-tests.yml/badge.svg)](https://github.com/Uzziahlukeka/telegrammonitor/actions/workflows/run-tests.yml/badge.svg)[![Code style](https://github.com/Uzziahlukeka/telegrammonitor/actions/workflows/fix-php-code-style-issues.yml/badge.svg)](https://github.com/Uzziahlukeka/telegrammonitor/actions/workflows/fix-php-code-style-issues.yml/badge.svg)[![Total Downloads](https://camo.githubusercontent.com/d514710c6c7e90ead61633fb30841a3858e18cb04c2a3a7e3b128d72bf76af59/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f757a686c61726176656c2f74656c656772616d6c6f67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/uzhlaravel/telegramlogs)[![License](https://camo.githubusercontent.com/e890f34d290e8e23b3dde7385931221edbc98b427ae3c8fdf2b4196399c9994b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f757a686c61726176656c2f74656c656772616d6c6f67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/uzhlaravel/telegramlogs)

---

A comprehensive Laravel package that seamlessly integrates Telegram notifications into your application's logging system.
Monitor critical events, debug issues, and stay informed about your application's health in real-time through Telegram channels or groups.

Supercharge your Laravel application monitoring with real-time Telegram messages from a form or external source.

---

Table of Contents
-----------------

[](#table-of-contents)

- [Introduction](#introduction)
    - [Why Use Telegram Logs Monitor?](#why-use-telegram-logs-monitor)
    - [why use telegram messages ?](#why-use-telegram-messages-)
    - [Core Features](#core-features)
- [Installation](#installation)
    - [Prerequisites](#prerequisites)
    - [Quick Installation](#quick-installation)
    - [Automated Setup](#automated-setup)
    - [Manual Installation](#manual-installation)
    - [Log Channel Setup](#log-channel-setup)
    - [Configuration](#configuration)
        - [Environment Variables](#environment-variables)
        - [Reference](#reference)
- [Basic Usage](#basic-usage)
    - [LOGS](#logs)
    - [Standard Logging](#standard-logging)
    - [Command Line Utilities](#command-line-utilities)
    - [Output Formatting](#output-formatting)
    - [Supported Log Levels](#supported-log-levels)
    - [Direct Messaging Interface](#direct-messaging-interface)
- [Getting Telegram Credentials](#getting-telegram-credentials)
    - [1. Create a Telegram Bot](#1-create-a-telegram-bot)
    - [2. Get Chat ID](#2-get-chat-id)
    - [3. Forum Topics (optional)](#3-forum-topics-optional)
- [Security Best Practices](#security-best-practices)
- [Contributing](#contributing)
    - [Development Setup](#development-setup)
- [Support](#support)
- [License](#license)
- [Attribution](#attribution)

---

Introduction
------------

[](#introduction)

Telegram Logs Monitor is a comprehensive Laravel package that seamlessly integrates Telegram notifications into your application's logging system. Monitor critical events, debug issues, and stay informed about your application's health in real-time through Telegram channels.

### Why Use Telegram Logs Monitor?

[](#why-use-telegram-logs-monitor)

- **Real-time Monitoring** → Instant delivery of critical notifications to your Telegram channels
- **Comprehensive Coverage** → Support for all PSR-3 log levels from debug to emergency
- **Smart Formatting** → Beautiful JSON formatting with MarkdownV2 and HTML support
- **Error Resilience** → Graceful fallback when Telegram is unavailable
- **Developer Friendly** → Interactive setup and comprehensive testing tools

### why use telegram messages ?

[](#why-use-telegram-messages-)

it is made to simplify life and handle receiving messages from a form or external source as form and view it into your telegram channel.

- **Real-time Messaging** → Instant delivery of messages notifications to your Telegram channels
- **Smart Formatting** → Beautiful text format with details on the source
- **Error Resilience** → Graceful fallback when Telegram is unavailable

---

---

Core Features
-------------

[](#core-features)

### Essential Functionality

[](#essential-functionality)

- **Monolog Integration**
- **Direct Messaging API**
- **Real-time Notifications**
- **Interactive Setup**
- **Comprehensive Testing**

### Advanced Capabilities

[](#advanced-capabilities)

- **Multi-level Logging**
- **Forum Groups Support**
- **Smart Message Handling**
- **Performance Optimized**
- **Error Resilience**

---

Installation
------------

[](#installation)

### Prerequisites

[](#prerequisites)

- **PHP**: 8.1 or higher
- **Laravel**: 10.0 or higher
- **Telegram Bot Token**: Obtain from [BotFather](https://core.telegram.org/bots#botfather)
- **Telegram Channel/Group Chat ID**: Destination for log notifications

### Quick Installation

[](#quick-installation)

```
composer require uzhlaravel/telegramlogs
```

### Automated Setup

[](#automated-setup)

```
php artisan telegramlogs:install
```

This guided process will:

- Publish the configuration file
- Help set up environment variables
- Optionally configure Telegram as your default logging channel
- Test your configuration

### Manual Installation

[](#manual-installation)

```
php artisan vendor:publish --tag="telegramlogs-config"
```

### Log Channel Setup

[](#log-channel-setup)

`.env` file:

```
LOG_CHANNEL=telegram
```

Configuration
-------------

[](#configuration)

### Environment Variables

[](#environment-variables)

```
TELEGRAM_BOT_TOKEN=your_bot_token_here
TELEGRAM_CHAT_ID=your_chat_id_here
TELEGRAM_TOPIC_ID=your_thread_id_here
TELEGRAM_TOPIC_MESSAGE_ID=your_message_id_here
TELEGRAM_TIMEOUT=10
TELEGRAM_LOG_LEVEL=critical
```

### Reference

[](#reference)

VariableDescriptionRequiredDefaultTELEGRAM\_BOT\_TOKENBot API tokenYes-TELEGRAM\_CHAT\_IDTarget chat/channel IDYes-TELEGRAM\_TOPIC\_IDForum topic IDNonullTELEGRAM\_TOPIC\_MESSAGE\_IDForum thread IDNonullTELEGRAM\_LOG\_LEVELMinimum log levelNocriticalTELEGRAM\_TIMEOUTAPI timeout (seconds)No10---

Basic Usage
-----------

[](#basic-usage)

---

### LOGS

[](#logs)

---

### Standard Logging

[](#standard-logging)

```
\Log::error('Payment processing failure detected');

try {
    // Application code
} catch (\Exception $e) {
    \Log::critical('API connectivity issue', [
        'exception' => $e->getMessage(),
        'code' => $e->getCode()
    ]);
}

\Log::debug('User authentication successful', [
    'user_id' => auth()->id(),
    'ip' => request()->ip()
]);
```

### Command Line Utilities

[](#command-line-utilities)

#### Configuration Validation

[](#configuration-validation)

```
php artisan telegramlogs:test
```

Options:

- `--message="Custom notification"` → Dispatch custom test message
- `--level=error` → Specify log severity level
- `--list` → Display available log levels
- `--config` → Show current configuration values

Example:

```
php artisan telegramlogs:test --message="System health check" --level=warning
```

### Output Formatting

[](#output-formatting)

```
{
  "message": "Database connection failure",
  "level": "CRITICAL",
  "datetime": "2025-08-17T11:55:13.885292+00:00",
  "context": {
    "exception": "PDOException: driver not found"
  }
}
```

---

Supported Log Levels
--------------------

[](#supported-log-levels)

LevelDescriptionExample Use CaseDebugDetailed diagnostic infoQuery debugging, variable inspectionInfoGeneral operational messagesUser login, cache clearingNoticeSignificant normal eventsNew user registration, order createdWarningPotential issuesAPI rate limiting, deprecated usageErrorRuntime errorsPayment failure, external API errorsCriticalCritical condition alertsDatabase connection failureAlertImmediate action requiredSecurity breach detectionEmergencySystem instabilityServer down, infrastructure failure---

Command Line Tools
------------------

[](#command-line-tools)

- This is for testing and configuration purposes only.
- You can use the facade to send messages to your Telegram channel.

```
php artisan telegramlogs:test --config //to see the config
php artisan telegramlogs:test --list // ot see the list of log levels
php artisan telegramlogs:test --message="System health check" --level=warning // to send a custom message
```

---

Direct Messaging Interface
--------------------------

[](#direct-messaging-interface)

---

To send a message to your Telegram channel or from a form or just a simple word you want to pass , you have to use the facade for it but make sure to import it first.

```
use Uzhlaravel\Telegramlogs\Facades\TelegramMessage;
```

then after this you can use the facade to send a message to your channel. like this :

```
use Uzhlaravel\Telegramlogs\Facades\TelegramMessage;

// Basic message transmission
TelegramMessage::message('System maintenance scheduled for tonight');

// Message with options
TelegramMessage::send('System maintenance scheduled for tonight', [
    'parse_mode' => 'HTML',
    'disable_web_page_preview' => true,
    'reply_markup' => [
        'inline_keyboard' => [
            [
                ['text' => 'Start', 'callback_data' => 'start']
            ]
        ]
    ]
]);

// Targeted chat messaging
TelegramMessage::toChat('-100123456789', 'Specific channel notification');

// Connection testing
TelegramMessage::test();
```

---

Getting Telegram Credentials
----------------------------

[](#getting-telegram-credentials)

### 1. Create a Telegram Bot

[](#1-create-a-telegram-bot)

1. Open @BotFather
2. Send `/newbot` and follow instructions
3. Copy token → `TELEGRAM_BOT_TOKEN`

### 2. Get Chat ID

[](#2-get-chat-id)

- **Private chats** → getUpdates API
- **Channels** → Add bot as admin → `-100xxxxxxxxx`
- **Groups** → Add bot, mention it → get `chat.id`

### 3. Forum Topics (optional)

[](#3-forum-topics-optional)

1. Create a topic
2. Send message
3. Get `message_thread_id`

---

Security Best Practices
-----------------------

[](#security-best-practices)

- Never commit tokens
- Restrict bot access
- Store secrets in `.env`
- Audit access regularly

---

Contributing
------------

[](#contributing)

1. Fork repo
2. Create branch → `git checkout -b feature/amazing-feature`
3. Commit → `git commit -m 'Add some amazing feature'`
4. Push → `git push origin feature/amazing-feature`
5. Open PR

### Development Setup

[](#development-setup)

```
git clone https://github.com/Uzziahlukeka/telegrammonitor.git
composer install
composer analyze
composer format
composer test
```

---

Support
-------

[](#support)

- Read docs + wiki
- Open issues on GitHub
- Join discussions

If helpful, consider:

- ⭐ Starring repo
- Sharing experience
- Reporting issues

---

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT License](LICENSE.md).

---

Attribution
-----------

[](#attribution)

- Developed by [Uzziahlukeka](https://github.com/Uzziahlukeka)
- Inspired by the Laravel community

---

💖 Made with love by [Uzziah Lukeka](https://github.com/Uzziahlukeka)

###  Health Score

40

—

FairBetter than 87% of packages

Maintenance63

Regular maintenance activity

Popularity24

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Recently: every ~2 days

Total

11

Last Release

255d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0c60a7476f54a95b4e406d4754f377ec19c39ee9c91a8e80c52d82ba57af3ab9?d=identicon)[uzziahlukeka](/maintainers/uzziahlukeka)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (365 commits)")[![mvdnbrk](https://avatars.githubusercontent.com/u/802681?v=4)](https://github.com/mvdnbrk "mvdnbrk (46 commits)")[![Uzziahlukeka](https://avatars.githubusercontent.com/u/102746022?v=4)](https://github.com/Uzziahlukeka "Uzziahlukeka (31 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (23 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (22 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (16 commits)")[![pforret](https://avatars.githubusercontent.com/u/474312?v=4)](https://github.com/pforret "pforret (16 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (14 commits)")[![patinthehat](https://avatars.githubusercontent.com/u/5508707?v=4)](https://github.com/patinthehat "patinthehat (10 commits)")[![riasvdv](https://avatars.githubusercontent.com/u/3626559?v=4)](https://github.com/riasvdv "riasvdv (9 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (8 commits)")[![crynobone](https://avatars.githubusercontent.com/u/172966?v=4)](https://github.com/crynobone "crynobone (8 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (7 commits)")[![irfanm96](https://avatars.githubusercontent.com/u/42065936?v=4)](https://github.com/irfanm96 "irfanm96 (5 commits)")[![thecaliskan](https://avatars.githubusercontent.com/u/13554944?v=4)](https://github.com/thecaliskan "thecaliskan (5 commits)")[![IGedeon](https://avatars.githubusercontent.com/u/694313?v=4)](https://github.com/IGedeon "IGedeon (4 commits)")[![yaroslawww](https://avatars.githubusercontent.com/u/23663794?v=4)](https://github.com/yaroslawww "yaroslawww (3 commits)")[![jessarcher](https://avatars.githubusercontent.com/u/4977161?v=4)](https://github.com/jessarcher "jessarcher (3 commits)")[![koossaayy](https://avatars.githubusercontent.com/u/6431084?v=4)](https://github.com/koossaayy "koossaayy (3 commits)")[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (3 commits)")

---

Tags

laravellogspackagephp8telegramlaravellogstelegramuzhlaraveltelegramlogstelegram monitordirect message

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/uzhlaravel-telegramlogs/health.svg)

```
[![Health](https://phpackages.com/badges/uzhlaravel-telegramlogs/health.svg)](https://phpackages.com/packages/uzhlaravel-telegramlogs)
```

###  Alternatives

[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
