PHPackages                             prog-time/tg-logger - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. prog-time/tg-logger

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

prog-time/tg-logger
===================

A Laravel package for sending logs to Telegram

1.0.0(1y ago)231.9k↑44%1MITPHPPHP ^8.0

Since Dec 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/prog-time/tg-logger)[ Packagist](https://packagist.org/packages/prog-time/tg-logger)[ RSS](/packages/prog-time-tg-logger/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

Telegram Logger for Laravel
===========================

[](#telegram-logger-for-laravel)

A module for Laravel that allows you to send logs to Telegram.

Description
-----------

[](#description)

This module allows you to send logs to a Telegram group, breaking them down by topic. You can describe the configuration for the basic log types or write your own logging levels.

Installing the module
---------------------

[](#installing-the-module)

The installation is done using Composer:

```
composer require prog-time/tg-logger
```

Configuring the module
----------------------

[](#configuring-the-module)

1. Create a Telegram bot
2. Create a Telegram group and include "Topics" in it
3. Specify the variables in .environment

```
TG_LOGGER_TOKEN="token_bot"
TG_LOGGER_CHAT_ID="id_group"
```

4. Add the created bot and grant it administrator rights
5. Create a configuration file **config/tg-logger.php** manually or using a command.

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

6. In **config/tg-logger.php** specify the bot token, the ID of the created group, and describe the topics that need to be created.

```
return [
    'token' => env('TG_LOGGER_TOKEN'),
    'chat_id' => env('TG_LOGGER_CHAT_ID'),
    'topics' => [
        [
            'name' => 'Debug messages',
            'icon_color' => '9367192',
            'level' => 'debug',
        ],
        [
            'name' => 'Cron tasks',
            'icon_color' => '9367192',
            'level' => 'crone',
        ],
        [
            'name' => 'Errors',
            'icon_color' => '9367192',
            'level' => 'error, notice, warning, emergency',
        ]
  ]
];
```

7. Run the command to create themes in a group. After executing this command, the file **config/tg-logger.php** it will be overwritten and the topic IDs for each log type will be indicated in it.

```
php artisan tglogger:create-topics
```

Sending any type of error
-------------------------

[](#sending-any-type-of-error)

To catch all types of errors, you need to change the basic log handler in the configuration file **config/logging.php** by specifying the module classes as handlers.

```
'channels' => [
        ...
        'telegram' => [
            'driver' => 'monolog',
            'handler' => ProgTime\TgLogger\TgHandler::class,
            'formatter' => ProgTime\TgLogger\TgFormatter::class,
            'level' => 'debug',
        ],
        ...
    ],

```

and in .env, change the **LOG\_CHANNEL parameter**

```
LOG_CHANNEL=telegram

```

Calling the module operation directly
-------------------------------------

[](#calling-the-module-operation-directly)

To work with the module directly, you can use the following code.

```
TgLogger::sendLog('Your message', 'level');
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

556d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/afb5b1ee820ff47f1e77906d1424c21ed6d58369a706b965a7f2558c13bcb6d4?d=identicon)[prog-time](/maintainers/prog-time)

---

Top Contributors

[![prog-time](https://avatars.githubusercontent.com/u/40496434?v=4)](https://github.com/prog-time "prog-time (28 commits)")

---

Tags

laravellaravel-packageloggerlogging

### Embed Badge

![Health badge](/badges/prog-time-tg-logger/health.svg)

```
[![Health](https://phpackages.com/badges/prog-time-tg-logger/health.svg)](https://phpackages.com/packages/prog-time-tg-logger)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.5k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M276](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M343](/packages/open-telemetry-sdk)

PHPackages © 2026

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