Skip to content

Commit

Permalink
Add 'exclude_fields' param to Slack handler
Browse files Browse the repository at this point in the history
  • Loading branch information
alyamovsky committed Jul 9, 2024
1 parent 06ddd76 commit 6a306b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions DependencyInjection/MonologExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']]);
Expand All @@ -686,6 +687,7 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
$handler['include_extra'],
$handler['level'],
$handler['bubble'],
$handler['exclude_fields'],
]);
break;

Expand Down

0 comments on commit 6a306b5

Please sign in to comment.