diff --git a/app/config/config_prod.yml b/app/config/config_prod.yml index 05e7347..4045ff5 100644 --- a/app/config/config_prod.yml +++ b/app/config/config_prod.yml @@ -13,25 +13,12 @@ monolog: main: type: fingers_crossed action_level: error - handler: main_grouped - main_grouped: - type: group - members: [rotated_file, telegram_deduplicated] - bubble: false + handler: rotated_file rotated_file: type: rotating_file path: "%kernel.logs_dir%/%kernel.environment%.log" max_files: 30 level: debug - telegram_deduplicated: - type: deduplication - action_level: error - handler: telegram - time: 600 - telegram: - type: service - id: unreal4u\MonologHandler - action_level: error # for commands console: type: console diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index 3151dc3..d501131 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -35,8 +35,6 @@ parameters: # Telegram bot telegram_token: "123456:some-token" telegram_max_connections: 2 - # Telegram monolog handler - telegram_log_chat_id: ~ # Sentry sentry_dsn: ~ diff --git a/app/config/services.yml b/app/config/services.yml index 6a36aa3..21617a4 100644 --- a/app/config/services.yml +++ b/app/config/services.yml @@ -100,8 +100,6 @@ services: tags: [{ name: console.command }] # Send message Skobkin\Bundle\PointToolsBundle\Command\TelegramSendMessageCommand: - arguments: - $logChatId: '%telegram_log_chat_id%' tags: [{ name: console.command }] @@ -188,12 +186,6 @@ services: $logger: null $client: '@app.http.telegram_client' - # Monolog handler - unreal4u\MonologHandler: - arguments: - $chatId: '%telegram_log_chat_id%' - $level: 'error' - # Private message processor Skobkin\Bundle\PointToolsBundle\Service\Telegram\PrivateMessageProcessor: arguments: diff --git a/composer.json b/composer.json index d602f72..978b49c 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,6 @@ "knplabs/knp-paginator-bundle": "^2.5", "unreal4u/telegram-api": "^2.2", "csa/guzzle-bundle": "^3", - "unreal4u/monolog-telegram": "^0.2.0", "symfony/web-server-bundle": "^3.3", "sentry/sentry-symfony": "^2.2" }, diff --git a/composer.lock b/composer.lock index 417ad79..a53a024 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ad4b1412bf70a26b450fa80443dd1fa2", + "content-hash": "c50bcdcd4c9deacaba7bb6c8456d6ce1", "packages": [ { "name": "composer/ca-bundle", @@ -4240,57 +4240,6 @@ "description": "Dummy logger that implements PSR-3 so that my own classes can work with a common base", "time": "2018-01-08T13:02:56+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.10.1", diff --git a/src/Skobkin/Bundle/PointToolsBundle/Command/TelegramSendMessageCommand.php b/src/Skobkin/Bundle/PointToolsBundle/Command/TelegramSendMessageCommand.php index 562cbac..4881fd3 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Command/TelegramSendMessageCommand.php +++ b/src/Skobkin/Bundle/PointToolsBundle/Command/TelegramSendMessageCommand.php @@ -12,13 +12,9 @@ class TelegramSendMessageCommand extends Command /** @var MessageSender */ private $messenger; - /** @var int */ - private $logChatId; - - public function __construct(MessageSender $messenger, int $logChatId) + public function __construct(MessageSender $messenger) { $this->messenger = $messenger; - $this->logChatId = $logChatId; parent::__construct(); } @@ -61,7 +57,7 @@ class TelegramSendMessageCommand extends Command try { $this->messenger->sendMessageToChat( - (int) $input->getOption('chat-id') ?: $this->logChatId, + (int) $input->getOption('chat-id'), $message ); } catch (\Exception $e) {