composer require unreal4u/monolog-telegram. Telegram Monolog handler added.

This commit is contained in:
Alexey Skobkin 2017-01-14 01:47:46 +03:00
parent eb5aa80430
commit ca62397cbb
5 changed files with 77 additions and 6 deletions

View file

@ -19,5 +19,9 @@ monolog:
path: "%kernel.logs_dir%/%kernel.environment%.log"
max_files: 30
level: debug
telegram:
type: service
id: app.log.telegram_handler
action_level: error
console:
type: console

View file

@ -35,3 +35,5 @@ parameters:
# Telegram bot
telegram_token: "123456:some-token"
telegram_max_connections: 2
# Telegram monolog handler
telegram_log_chat_id: ~

View file

@ -29,7 +29,8 @@
"knplabs/knp-markdown-bundle": "^1.4",
"knplabs/knp-paginator-bundle": "^2.5",
"unreal4u/telegram-api": "^2.2",
"csa/guzzle-bundle": "^2.1"
"csa/guzzle-bundle": "^2.1",
"unreal4u/monolog-telegram": "^0.2.0"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",

53
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "9b374e1b2cb413fbab3f0633d6f81c1a",
"content-hash": "88274224cc9dfe36d847acf69d5924d8",
"packages": [
{
"name": "csa/guzzle-bundle",
@ -3181,6 +3181,57 @@
],
"time": "2017-01-11T19:39:01+00:00"
},
{
"name": "unreal4u/monolog-telegram",
"version": "v0.2",
"source": {
"type": "git",
"url": "https://github.com/unreal4u/monolog-telegram.git",
"reference": "13c34ac16e9dad06e632ca8ed8aeee2d44663e5c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/unreal4u/monolog-telegram/zipball/13c34ac16e9dad06e632ca8ed8aeee2d44663e5c",
"reference": "13c34ac16e9dad06e632ca8ed8aeee2d44663e5c",
"shasum": ""
},
"require": {
"monolog/monolog": "~1.17",
"php": ">=7.0.0",
"unreal4u/telegram-api": "~2.1"
},
"require-dev": {
"phpmd/phpmd": "@stable",
"phpunit/phpunit": "@stable",
"squizlabs/php_codesniffer": "@stable"
},
"type": "library",
"autoload": {
"psr-4": {
"unreal4u\\": "src/unreal4u"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Camilo Sperberg",
"email": "me@unreal4u.com",
"homepage": "https://github.com/unreal4u/monolog-telegram/graphs/contributors"
}
],
"description": "Monolog handler to enable sending messages through Telegram",
"keywords": [
"api",
"monolog",
"monolog handler",
"telegram",
"telegram bot"
],
"time": "2016-12-14T00:25:05+00:00"
},
{
"name": "unreal4u/telegram-api",
"version": "v2.3.0",

View file

@ -186,15 +186,28 @@ services:
# Telegram services
# API client
app.telegram.api_client:
# Bot API client
app.telegram.bot_client:
class: unreal4u\TelegramAPI\TgLog
arguments: ['%telegram_token%', '@logger', '@app.http.telegram_client']
# Logger API client
app.telegram.logger_client:
class: unreal4u\TelegramAPI\TgLog
arguments: ['%telegram_token%', null, '@app.http.telegram_client']
# Monolog handler
app.log.telegram_handler:
class: unreal4u\MonologHandler
arguments:
- '@app.telegram.logger_client'
- '%telegram_log_chat_id%'
- 'error'
# Message sender
app.telegram.message_sender:
class: Skobkin\Bundle\PointToolsBundle\Service\Telegram\MessageSender
arguments: ['@app.telegram.api_client', '@twig']
arguments: ['@app.telegram.bot_client', '@twig']
# User notifier
app.telegram.notifier:
@ -212,7 +225,7 @@ services:
app.telegram.inline_query_processor:
class: Skobkin\Bundle\PointToolsBundle\Service\Telegram\InlineQueryProcessor
lazy: true
arguments: ['@app.point.user_repository', '@app.telegram.api_client']
arguments: ['@app.point.user_repository', '@app.telegram.bot_client']
# Private message processor
app.telegram.private_message_processor: