efureev / loogger-driver-php
PHP Support Package for Laravel DB
Installs: 642
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/efureev/loogger-driver-php
Requires
- php: ^8.0
- ext-curl: *
Requires (Dev)
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.6
This package is auto-updated.
Last update: 2025-10-17 16:33:29 UTC
README
Description
PHP driver for Loogger service to send notifications to Telegram.
Install
composer require efureev/loogger "^1.0"
Use
In your code:
$looggerConfig = new Config($looggerConfigJson); $loogger = new Loogger($looggerConfig); $loogger->send($msg); // ... $loogger ->pattern("<b>Gitlab</b>: {{MSG}}") ->sendHTML("<i>Hello from service</i>");
A Message type format:
$loogger ->asPlain() // send message as plain // ->send('Text') ->asHTML() // send message as HTML // ->send('<b>Bold</b> <pre>code</pre>') ->asMD() // send message as Markdown. // ->send('*Bold* text')
Allowed variables for patterns and message:
- MSG- The Message content
- SERVICE_NAME- The service name
- SERVICE_DESCRIPTION- The service description
- NOW- The datetime. Format:- RFC822
- CHAT_ID- The TG-chat ID
- BR- Return a cursor to the next line. Like a- \n.
- TAB- Return a cursor to the next line. Like a- \t.
from console-file:
php send2loogger.php --msg='Testing message!'
Arguments:
- --cnf=<path>- A full path to config file. Config file should be a JSON typed.
- --msg='<text>'- A sending message
- --debug- Enables- debug mode
from curl:
curl --location --request POST 'https://loogger.mockery.dev/push' \ --header 'X-Token: $2a$10$du8TEzvOs6HTgrbkuuTl0JNnhGF2Ki3xLKuPG5LoGBcn4S91W' \ --data-raw 'Hello from service'
Use Loogger service
Loogger is a service to send various notifications.
Nowdays, it has only one driver: Telegram.
The service located at https://loogger.mockery.dev.
To use the Loogger service you should register there through Telegram:
- Add tg-bot @Looggerto your group or direct chat to it.
- To register into Loogger:
 For person chat: you should send auth data to it.
 For group chat: nothing.
- Create a service: /add
A full list of commands you receive on /help