PHPackages                             abergasov/telegram\_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. abergasov/telegram\_logger

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

abergasov/telegram\_logger
==========================

Telegram php logger

1.0.6(6y ago)1188↓100%MITPHPPHP &gt;=5.6.0CI failing

Since Jul 8Pushed 6y agoCompare

[ Source](https://github.com/abergasov/telegram_logger)[ Packagist](https://packagist.org/packages/abergasov/telegram_logger)[ Docs](https://github.com/abergasov/telegram_logger)[ RSS](/packages/abergasov-telegram-logger/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (1)Versions (8)Used By (0)

telegram\_logger
================

[](#telegram_logger)

PHP logger for web site/app

Example messages telegram/slack
-------------------------------

[](#example-messages-telegramslack)

[![Repo_List](images/img_1.png?raw=true)](images/img_1.png?raw=true)

[![Repo_List](images/img_2.png?raw=true)](images/img_2.png?raw=true)

[![Repo_List](images/slack_example.png)](images/slack_example.png)

Instalation
-----------

[](#instalation)

> composer require abergasov/telegram\_logger

Usage
-----

[](#usage)

```
const INFO_CHAT = 0;
const ERROR_CHAT = 1;
const CONTACT_CHAT = 2;

$logger = new TelegramLogger([
    'token' => SET_YOUR_TOKEN_HERE,
    'chats' => [
        INFO_CHAT => -199024103,
        ERROR_CHAT => -293646246,
        CONTACT_CHAT => -305488244,
        ... add more or less if need
    ],
    'trace_dir' => __DIR__ . '/trace/logs',
    'decorate_url' => 'https://example.com/trace/logs',
    'logs' => [
        'access_log' => '/home/admin/web/my_site/logs/access_log.log',
        'error_log' => '/home/admin/web/my_site/logs/error_log.log',
    ]
]);
$logger->addSlackConfig([
    'token' => SET_YOUR_SLACK_TOKEN_HERE,
    'channels' => [
        INFO_CHAT => 'GF4UTEHGB',
        ERROR_CHAT => 'GF4UTEHGB',
        CONTACT_CHAT => 'GF4UTEHGB',
    ],
]);

$result = $logger->sendMessage(INFO_CHAT, 'Hello, I need help', 'Additional info 1', 'Additional info 2', 'Additional info 3');
echo ($result ? 'Info message was send' : 'Troubles in send messages') . PHP_EOL;

try {
    throw new RuntimeException('Something went wrong in this world');
} catch (Throwable $t) {
    $logger->sendMessage(ERROR_CHAT, 'Exception in script', $t);
}

```

Config documentation
--------------------

[](#config-documentation)

KeyTypeDescriptiontokenStringbot tokenchatsArraylist of chats to send message. See example.phptrace\_dirString/BooleanBy default false Directory where should put trace log file. Must be writable. For example /home/admin/web/site/public\_html/trace/logsdecorate\_urlStringEmpty by default. Url for access to file via browser. For example ""logsArrayEmpty by default. path to acess log and error logs. Must be readable. See example.php for detailsCreating telegram bot tutorial
------------------------------

[](#creating-telegram-bot-tutorial)

- Find BotFather.
- Send /newbot.
- Set up name and bot-name for your bot.
- Get token and add it to your .env file.
- Find your bot (BotFather already generate link to it in last message).
- Send one or few messages to him.
- Open next url &lt;YOUR\_BOT\_TOKEN&gt;/getUpdates and find chat\_id.
- find @myidbot and send him /getid for personal chat
- find @myidbot add him to group and send him /getgroupid@myidbot for chat id

[![telegram_logger](https://github.com/abergasov/telegram_logger/raw/master/images/img_3.png?raw=true)](https://github.com/abergasov/telegram_logger/blob/master/images/img_3.png?raw=true)

###  Health Score

27

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

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

Every ~33 days

Total

7

Last Release

2244d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/617e714dead39de5d3af54259af864aa4efb4f2e3a33fe726f46d94fa29845dd?d=identicon)[abergasov](/maintainers/abergasov)

---

Top Contributors

[![abergasov](https://avatars.githubusercontent.com/u/17740693?v=4)](https://github.com/abergasov "abergasov (28 commits)")

---

Tags

phpcomposerloggertelegram

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/abergasov-telegram-logger/health.svg)

```
[![Health](https://phpackages.com/badges/abergasov-telegram-logger/health.svg)](https://phpackages.com/packages/abergasov-telegram-logger)
```

###  Alternatives

[justbetter/magento2-sentry

Magento 2 Logger for Sentry

1821.4M3](/packages/justbetter-magento2-sentry)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Dump、Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14241.9k1](/packages/guanguans-laravel-exception-notify)[jackmartin/telegram-logger-errors

Telegram logger errors package laravel

1331.3k](/packages/jackmartin-telegram-logger-errors)

PHPackages © 2026

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