|
207 | 207 | * - [level]: level name or int value, defaults to DEBUG
|
208 | 208 | * - [bubble]: bool, defaults to true
|
209 | 209 | *
|
| 210 | + * - slackwebhook: |
| 211 | + * - webhook_url: slack webhook URL |
| 212 | + * - channel: channel name (with starting #) |
| 213 | + * - [bot_name]: defaults to Monolog |
| 214 | + * - [icon_emoji]: defaults to null |
| 215 | + * - [use_attachment]: bool, defaults to true |
| 216 | + * - [use_short_attachment]: bool, defaults to false |
| 217 | + * - [include_extra]: bool, defaults to false |
| 218 | + * - [level]: level name or int value, defaults to DEBUG |
| 219 | + * - [bubble]: bool, defaults to true |
| 220 | + * |
| 221 | + * - slackbot: |
| 222 | + * - team: slack team slug |
| 223 | + * - token: slackbot token |
| 224 | + * - channel: channel name (with starting #) |
| 225 | + * - [level]: level name or int value, defaults to DEBUG |
| 226 | + * - [bubble]: bool, defaults to true |
| 227 | + * |
210 | 228 | * - cube:
|
211 | 229 | * - url: http/udp url to the cube server
|
212 | 230 | * - [level]: level name or int value, defaults to DEBUG
|
@@ -351,15 +369,17 @@ public function getConfigTreeBuilder()
|
351 | 369 | ->scalarNode('room')->end() // hipchat
|
352 | 370 | ->scalarNode('message_format')->defaultValue('text')->end() // hipchat
|
353 | 371 | ->scalarNode('api_version')->defaultNull()->end() // hipchat
|
354 |
| - ->scalarNode('channel')->end() // slack |
355 |
| - ->scalarNode('bot_name')->defaultValue('Monolog')->end() // slack |
356 |
| - ->scalarNode('use_attachment')->defaultTrue()->end() // slack |
357 |
| - ->scalarNode('use_short_attachment')->defaultFalse()->end() // slack |
358 |
| - ->scalarNode('include_extra')->defaultFalse()->end() // slack |
359 |
| - ->scalarNode('icon_emoji')->defaultNull()->end() // slack |
| 372 | + ->scalarNode('channel')->defaultNull()->end() // slack & slackwebhook & slackbot |
| 373 | + ->scalarNode('bot_name')->defaultValue('Monolog')->end() // slack & slackwebhook |
| 374 | + ->scalarNode('use_attachment')->defaultTrue()->end() // slack & slackwebhook |
| 375 | + ->scalarNode('use_short_attachment')->defaultFalse()->end() // slack & slackwebhook |
| 376 | + ->scalarNode('include_extra')->defaultFalse()->end() // slack & slackwebhook |
| 377 | + ->scalarNode('icon_emoji')->defaultNull()->end() // slack & slackwebhook |
| 378 | + ->scalarNode('webhook_url')->end() // slackwebhook |
| 379 | + ->scalarNode('slack_team')->end() // slackbot |
360 | 380 | ->scalarNode('notify')->defaultFalse()->end() // hipchat
|
361 | 381 | ->scalarNode('nickname')->defaultValue('Monolog')->end() // hipchat
|
362 |
| - ->scalarNode('token')->end() // pushover & hipchat & loggly & logentries & flowdock & rollbar & slack |
| 382 | + ->scalarNode('token')->end() // pushover & hipchat & loggly & logentries & flowdock & rollbar & slack & slackbot |
363 | 383 | ->scalarNode('source')->end() // flowdock
|
364 | 384 | ->booleanNode('use_ssl')->defaultTrue()->end() // logentries & hipchat
|
365 | 385 | ->variableNode('user') // pushover
|
@@ -692,6 +712,14 @@ public function getConfigTreeBuilder()
|
692 | 712 | ->ifTrue(function ($v) { return 'slack' === $v['type'] && (empty($v['token']) || empty($v['channel'])); })
|
693 | 713 | ->thenInvalid('The token and channel have to be specified to use a SlackHandler')
|
694 | 714 | ->end()
|
| 715 | + ->validate() |
| 716 | + ->ifTrue(function ($v) { return 'slackwebhook' === $v['type'] && (empty($v['webhook_url'])); }) |
| 717 | + ->thenInvalid('The webhook_url have to be specified to use a SlackWebhookHandler') |
| 718 | + ->end() |
| 719 | + ->validate() |
| 720 | + ->ifTrue(function ($v) { return 'slackbot' === $v['type'] && (empty($v['stack_team']) || empty($v['token']) || empty($v['channel'])); }) |
| 721 | + ->thenInvalid('The stack_team, token and channel have to be specified to use a SlackbotHandler') |
| 722 | + ->end() |
695 | 723 | ->validate()
|
696 | 724 | ->ifTrue(function ($v) { return 'cube' === $v['type'] && empty($v['url']); })
|
697 | 725 | ->thenInvalid('The url has to be specified to use a CubeHandler')
|
|
0 commit comments