定制 efureev/loogger-driver-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

efureev/loogger-driver-php

Composer 安装命令:

composer require efureev/loogger-driver-php

包简介

PHP Support Package for Laravel DB

README 文档

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 @Loogger to 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

统计信息

  • 总下载量: 642
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固