From 789a3229e581f569d131c372834cedb271b879ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 27 Oct 2025 15:55:46 +0100 Subject: [PATCH] Update monolog configuration and extend logrotate for notifier logs Revised `monolog.yaml` to add a new "notifier" channel, updated handlers, and adjusted log settings. Extended logrotate configuration to include rotation rules for notifier logs, ensuring proper log management. --- templates/config/prod/monolog.yaml | 47 +++++++++++++++++++----------- templates/logrotate/chill | 11 ++++++- 2 files changed, 40 insertions(+), 18 deletions(-) diff --git a/templates/config/prod/monolog.yaml b/templates/config/prod/monolog.yaml index b4d0bfe..957d1f4 100644 --- a/templates/config/prod/monolog.yaml +++ b/templates/config/prod/monolog.yaml @@ -1,20 +1,33 @@ # this file is managed by ansible. Do not edit it by hand + +# +# NOTE: the ansible-role-chill will also configure a rule for logrotate, so, +# we do not need to configure log rotation here +# + parameters: - log_prefix: {{ item.chill_environment }} + log_prefix: 'test' monolog: - handlers: - default_log: - type: stream - path: "%kernel.logs_dir%/privacy-%log_prefix%.log" - level: info - channels: ['chill'] - chill_log: - type: stream - path: "%kernel.logs_dir%/default-%log_prefix%.log" - level: info - channels: ['!event', '!doctrine', '!console', '!chill'] - console: - type: console - process_psr_3_messages: false - channels: ['!event', '!doctrine', '!console'] - bubble: false + # make a "notifier" channel available + channels: ['notifier'] + handlers: + notifier_log: + type: stream + path: "%kernel.logs_dir%/notifier-%log_prefix%.log" + level: info + channels: [ 'notifier' ] + privacy_log: + type: stream + path: "%kernel.logs_dir%/privacy-%log_prefix%.log" + level: info + channels: [ 'chill' ] + default_log: + type: stream + path: "%kernel.logs_dir%/default-%log_prefix%.log" + level: info + channels: [ '!event', '!doctrine', '!console', '!chill',] + console: + type: console + process_psr_3_messages: false + channels: [ '!event', '!doctrine', '!console'] + bubble: true diff --git a/templates/logrotate/chill b/templates/logrotate/chill index 3f8dd85..109188d 100644 --- a/templates/logrotate/chill +++ b/templates/logrotate/chill @@ -14,4 +14,13 @@ compress missingok notifempty -} \ No newline at end of file +} + +/var/log/apt/notifier-*.log { + su php-fpm php-fpm + rotate 800 + daily + compress + missingok + notifempty +}