PHPackages                             protounit/watchtower - 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. protounit/watchtower

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

protounit/watchtower
====================

Monolog wrapper that sends your logs to Telegram channel

1.3(7y ago)119MITPHPPHP &gt;=7.0

Since Jul 25Pushed 7y agoCompare

[ Source](https://github.com/protounit/watchtower)[ Packagist](https://packagist.org/packages/protounit/watchtower)[ RSS](/packages/protounit-watchtower/feed)WikiDiscussions master Synced 2w ago

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

protounit/Watchtower
====================

[](#protounitwatchtower)

Telegram handler for Monolog. Send log info to channel with pretty formatting and useful information

[![Telegram Channel Screenshot](https://camo.githubusercontent.com/de87f717b3811bc1a9705cfa48695b7d01d3261ec46310a299c6afbadda6739a/68747470733a2f2f696d6167652e6962622e636f2f6670466570542f53637265656e73686f745f32303138303732365f3031333232362e706e67 "protounit/watchtower")](https://camo.githubusercontent.com/de87f717b3811bc1a9705cfa48695b7d01d3261ec46310a299c6afbadda6739a/68747470733a2f2f696d6167652e6962622e636f2f6670466570542f53637265656e73686f745f32303138303732365f3031333232362e706e67)

*Inspired by* [monolog-telegram](https://github.com/moeinrahimi/monolog-telegram)

Dependencies
------------

[](#dependencies)

[monolog/monolog](https://github.com/Seldaek/monolog)[guzzlehttp/guzzle](https://github.com/guzzle/guzzle)

How it works
------------

[](#how-it-works)

- Watchtower handle Monolog methods to send messages
- After text formatting it creates fork of process and send message via guzzle
- Parent process doing nothing so you don't wait until it stops requesting Telegram API
- Child process waits for response and die after job is done
- If you set config option `'useFork' => false` guzzle will wait for response from Telegram API and hold your app till

*Too much messages per time could eat all of your RAM because there is no fork bomb detectors!*

Install
-------

[](#install)

```
composer require protounit/watchtower
composer install
```

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

[](#configuration)

This array represents full amount of options you need to make package work

```
$config = [
	'botId'     => 'BOTID:BOTID',
	'channelId' => 'CHANNELID',
	'timeZone'  => 'Europe/Rome',
	'useFork    => true
];
```

Example
-------

[](#example)

```
