PHPackages                             congnv/monolog-telegram-handler - 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. congnv/monolog-telegram-handler

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

congnv/monolog-telegram-handler
===============================

Telegram Handler for Monolog.

1.0.3(1y ago)110MITPHPPHP &gt;=8.1

Since May 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/congnv0330/monolog-telegram-handler)[ Packagist](https://packagist.org/packages/congnv/monolog-telegram-handler)[ RSS](/packages/congnv-monolog-telegram-handler/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

Telegram Logging Handler
========================

[](#telegram-logging-handler)

Telegram handler for Monolog.

Install
-------

[](#install)

```
composer require congnv/monolog-telegram-handler

```

Declaring handler object
------------------------

[](#declaring-handler-object)

To declare this handler, you need to know the bot token and the chat identifier(chat\_id) to which the log will be sent.

```
$handler = new \TelegramLog\TelegramHandler('', '');

```

Using with Laravel
------------------

[](#using-with-laravel)

Add telegram channel to `config/logging.php`

```
'telegram' => [
    'driver'  => 'custom',
    'via' => \TelegramLog\TelegramLogger::class,
    'level' => env('LOG_LEVEL', 'debug'),
    'bot_token' => env('TELEGRAM_BOT_TOKEN'),
    'chat_id' => env('TELEGRAM_CHAT_ID'),
    // 'max_stack_line' => 10,
],
```

Custom message formatter
------------------------

[](#custom-message-formatter)

Create new class implements \\TelegramLog\\TelegramMessageFormatterInterface

Example

```
