PHPackages                             php-core/simple-telegram-log - 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. php-core/simple-telegram-log

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

php-core/simple-telegram-log
============================

A simple Telegram logging helper for PHP

0169PHP

Since May 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/php-core/simple-telegram-log)[ Packagist](https://packagist.org/packages/php-core/simple-telegram-log)[ RSS](/packages/php-core-simple-telegram-log/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Simple Telegram Log
===================

[](#simple-telegram-log)

### A simple Telegram logging helper for PHP

[](#a-simple-telegram-logging-helper-for-php)

Usage
-----

[](#usage)

```
composer require php-core/simple-telegram-log
```

### Examples:

[](#examples)

#### Using environment vars (short usage)

[](#using-environment-vars-short-usage)

```
use PHPCore\SimpleTelegramLog\TGLog;

require_once dirname(__DIR__) . '/vendor/autoload.php';

TGLog::logMessage('Test message');
```

#### In code (flexible usage)

[](#in-code-flexible-usage)

```
use PHPCore\SimpleTelegramLog\TGLog;

require_once dirname(__DIR__) . '/vendor/autoload.php';

TGLog::init(
    '123456:124334534534', // tg bot token
    -14943993494, // tg chat id
    null, // tg channel topic id
    false // debug mode
)->sendMessage('Test message');
```

#### Logging a PHP "Exception/Throwable"

[](#logging-a-php-exceptionthrowable)

```
use PHPCore\SimpleTelegramLog\TGLog;

require_once dirname(__DIR__).'/vendor/autoload.php';

TGLog::logException(new Exception('Test exception'));
```

#### Log request dump

[](#log-request-dump)

```
use PHPCore\SimpleTelegramLog\TGLog;

require_once dirname(__DIR__).'/vendor/autoload.php';

TGLog::logRequestDump();
```

#### Debug log

[](#debug-log)

```
use PHPCore\SimpleTelegramLog\TGLog;

require_once dirname(__DIR__).'/vendor/autoload.php';

TGLog::debugLogMessage('This message will only be logged if debug mode is on');
```

#### Using custom Bot API

[](#using-custom-bot-api)

```
use PHPCore\SimpleTelegramLog\TGLog;

require_once dirname(__DIR__).'/vendor/autoload.php';

TGLog::init(
    '123456:124334534534', // tg bot token
    -14943993494, // tg chat id
    null, // tg channel topic id
    false, // debug mode
    'https://tg-bot-api.php-core.com' // custom Bot API server url
)->sendMessage('Test message');
```

#### Using a cli program for HTTP requests (requires ability to run PHP's "exec" function and a cli program like "wget" installed)

[](#using-a-cli-program-for-http-requests-requires-ability-to-run-phps-exec-function-and-a-cli-program-like-wget-installed)

```
use PHPCore\SimpleTelegramLog\TGLog;

require_once dirname(__DIR__).'/vendor/autoload.php';

TGLog::init(
    '123456:124334534534', // tg bot token
    -14943993494, // tg chat id
    null, // tg channel topic id
    false, // debug mode
    TGLog::API_BASE_URL, // custom Bot API server url
    'wget' // (or "curl") the cli program to use for the HTTP request
)->sendMessage('Test message');
```

#### Using a cli program with nohup for HTTP requests (requires ability to run PHP's "exec" function and "nohup" as well as a cli program like "wget" installed)

[](#using-a-cli-program-with-nohup-for-http-requests-requires-ability-to-run-phps-exec-function-and-nohup-as-well-as-a-cli-program-like-wget-installed)

```
use PHPCore\SimpleTelegramLog\TGLog;

require_once dirname(__DIR__).'/vendor/autoload.php';

TGLog::init(
    '123456:124334534534', // tg bot token
    -14943993494, // tg chat id
    null, // tg channel topic id
    false, // debug mode
    TGLog::API_BASE_URL, // custom Bot API server url
    'exec nohup setsid wget' // (or "curl") the cli program to use for the HTTP request
)->sendMessage('Test message');
```

#### Optional Environment Variables for simple use:

[](#optional-environment-variables-for-simple-use)

VariableDefaultDescriptionDEBUGfalse"true" or "false" enables or disables debug modeTG\_LOG\_BOT\_TOKENxThe default bot token to use for sending log messagesTG\_LOG\_CHAT\_IDxThe default chat ID to send log messages toTG\_LOG\_TOPIC\_IDxThe default channel topic ID to send log messages toTG\_LOG\_BOT\_SERVER\_URLThe base URL of the Bot API to useTG\_LOG\_BOT\_HTTP\_CMDxOptional cli program to use in PHP's "exec" function for HTTP requests (e.g "curl" or "wget")

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/103283996?v=4)[PHP Core](/maintainers/php-core)[@php-core](https://github.com/php-core)

### Embed Badge

![Health badge](/badges/php-core-simple-telegram-log/health.svg)

```
[![Health](https://phpackages.com/badges/php-core-simple-telegram-log/health.svg)](https://phpackages.com/packages/php-core-simple-telegram-log)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[ekino/newrelic-bundle

Integrate New Relic into Symfony2

28111.2M8](/packages/ekino-newrelic-bundle)

PHPackages © 2026

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