From 144a535c6b1758b97242d498a48fb56621ce4536 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Sat, 14 Jan 2017 03:56:17 +0300 Subject: [PATCH] Monolog Telegram handler reconfigured for prod environment. New 'subscribers_update' channel. --- app/config/config_prod.yml | 16 +++++++++++++--- .../Resources/config/services.yml | 6 +++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/config/config_prod.yml b/app/config/config_prod.yml index c6ee1ec..90af5ea 100644 --- a/app/config/config_prod.yml +++ b/app/config/config_prod.yml @@ -13,15 +13,25 @@ monolog: main: type: fingers_crossed action_level: error - handler: nested - nested: + handler: main_grouped + main_grouped: + type: group + members: [rotated_file, telegram_deduplicated] + bubble: false + 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: app.log.telegram_handler action_level: error + # for commands console: - type: console + type: console diff --git a/src/Skobkin/Bundle/PointToolsBundle/Resources/config/services.yml b/src/Skobkin/Bundle/PointToolsBundle/Resources/config/services.yml index f56d466..e2db511 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Resources/config/services.yml +++ b/src/Skobkin/Bundle/PointToolsBundle/Resources/config/services.yml @@ -44,6 +44,8 @@ services: - '@logger' - '@app.point.subscription_repository' - '@app.point.subscription_record_repository' + tags: + - { name: monolog.logger, channel: subscribers_update } # Console commands @@ -57,7 +59,9 @@ services: - [setApiClient, ['@app.point.api_user']] - [setApiDelay, ['%point_api_delay%']] - [setSubscriptionManager, ['@app.point.subscriptions_manager']] - tags: [{ name: console.command }] + tags: + - { name: console.command } + - { name: monolog.logger, channel: subscribers_update } # Webhook management app.telegram.webhook_command: class: Skobkin\Bundle\PointToolsBundle\Command\TelegramWebHookCommand