From 6a306b5f6a4829324b04f1096f6e73ed2ca666c4 Mon Sep 17 00:00:00 2001 From: Andrew Alyamovsky Date: Tue, 9 Jul 2024 15:25:04 +0200 Subject: [PATCH] Add 'exclude_fields' param to Slack handler --- DependencyInjection/Configuration.php | 6 ++++++ DependencyInjection/MonologExtension.php | 2 ++ 2 files changed, 8 insertions(+) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index eea9347f..6ae807d9 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -268,6 +268,7 @@ * - [bubble]: bool, defaults to true * - [timeout]: float * - [connection_timeout]: float + * - [exclude_fields]: list of excluded fields, defaults to empty array * * - slackwebhook: * - webhook_url: slack webhook URL @@ -279,6 +280,7 @@ * - [include_extra]: bool, defaults to false * - [level]: level name or int value, defaults to DEBUG * - [bubble]: bool, defaults to true + * - [exclude_fields]: list of excluded fields, defaults to empty array * * - slackbot: * - team: slack team slug @@ -549,6 +551,10 @@ public function getConfigTreeBuilder(): TreeBuilder ->scalarNode('include_extra')->defaultFalse()->end() // slack & slackwebhook ->scalarNode('icon_emoji')->defaultNull()->end() // slack & slackwebhook ->scalarNode('webhook_url')->end() // slackwebhook + ->arrayNode('exclude_fields') + ->canBeUnset() + ->prototype('scalar')->end() + ->end() // slack & slackwebhook ->scalarNode('team')->end() // slackbot ->scalarNode('notify')->defaultFalse()->end() // hipchat ->scalarNode('nickname')->defaultValue('Monolog')->end() // hipchat diff --git a/DependencyInjection/MonologExtension.php b/DependencyInjection/MonologExtension.php index 0e64f088..0f653a86 100644 --- a/DependencyInjection/MonologExtension.php +++ b/DependencyInjection/MonologExtension.php @@ -666,6 +666,7 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler $handler['bubble'], $handler['use_short_attachment'], $handler['include_extra'], + $handler['exclude_fields'], ]); if (isset($handler['timeout'])) { $definition->addMethodCall('setTimeout', [$handler['timeout']]); @@ -686,6 +687,7 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler $handler['include_extra'], $handler['level'], $handler['bubble'], + $handler['exclude_fields'], ]); break;