|
208 | 208 | * - [level]: level name or int value, defaults to DEBUG |
209 | 209 | * - [bubble]: bool, defaults to true |
210 | 210 | * |
| 211 | + * - rollbar: |
| 212 | + * - id: RollbarNotifier service (mandatory if token is not provided) |
| 213 | + * - token: rollbar api token (skip if you provide a RollbarNotifier service id) |
| 214 | + * - [config]: config values from https://github.com/rollbar/rollbar-php#configuration-reference |
| 215 | + * - [level]: level name or int value, defaults to DEBUG |
| 216 | + * - [bubble]: bool, defaults to true |
| 217 | + * |
211 | 218 | * @author Jordi Boggiano <[email protected]> |
212 | 219 | * @author Christophe Coevoet <[email protected]> |
213 | 220 | */ |
@@ -249,7 +256,7 @@ public function getConfigTreeBuilder() |
249 | 256 | ->then(function ($v) { return strtolower($v); }) |
250 | 257 | ->end() |
251 | 258 | ->end() |
252 | | - ->scalarNode('id')->end() |
| 259 | + ->scalarNode('id')->end() // service & rollbar |
253 | 260 | ->scalarNode('priority')->defaultValue(0)->end() |
254 | 261 | ->scalarNode('level')->defaultValue('DEBUG')->end() |
255 | 262 | ->booleanNode('bubble')->defaultTrue()->end() |
@@ -280,7 +287,7 @@ public function getConfigTreeBuilder() |
280 | 287 | ->scalarNode('room')->end() // hipchat |
281 | 288 | ->scalarNode('notify')->defaultFalse()->end() // hipchat |
282 | 289 | ->scalarNode('nickname')->defaultValue('Monolog')->end() // hipchat |
283 | | - ->scalarNode('token')->end() // pushover & hipchat & loggly & logentries & flowdock |
| 290 | + ->scalarNode('token')->end() // pushover & hipchat & loggly & logentries & flowdock & rollbar |
284 | 291 | ->scalarNode('source')->end() // flowdock |
285 | 292 | ->booleanNode('use_ssl')->defaultTrue()->end() // logentries |
286 | 293 | ->variableNode('user') // pushover |
@@ -341,6 +348,10 @@ public function getConfigTreeBuilder() |
341 | 348 | ->thenInvalid('If you set user, you must provide a password.') |
342 | 349 | ->end() |
343 | 350 | ->end() // mongo |
| 351 | + ->arrayNode('config') |
| 352 | + ->canBeUnset() |
| 353 | + ->prototype('scalar')->end() |
| 354 | + ->end() // rollbar |
344 | 355 | ->arrayNode('members') // group |
345 | 356 | ->canBeUnset() |
346 | 357 | ->performNoDeepMerging() |
@@ -518,6 +529,14 @@ public function getConfigTreeBuilder() |
518 | 529 | ->ifTrue(function ($v) { return 'filter' === $v['type'] && "EMERGENCY" !== $v['max_level'] && !empty($v['accepted_levels']); }) |
519 | 530 | ->thenInvalid('You can not use max_level together with accepted_levels in a FilterHandler') |
520 | 531 | ->end() |
| 532 | + ->validate() |
| 533 | + ->ifTrue(function ($v) { return 'rollbar' === $v['type'] && !empty($v['id']) && !empty($v['token']); }) |
| 534 | + ->thenInvalid('You can not use both an id and a token in a RollbarHandler') |
| 535 | + ->end() |
| 536 | + ->validate() |
| 537 | + ->ifTrue(function ($v) { return 'rollbar' === $v['type'] && empty($v['id']) && empty($v['token']); }) |
| 538 | + ->thenInvalid('The id or the token has to be specified to use a RollbarHandler') |
| 539 | + ->end() |
521 | 540 | ->validate() |
522 | 541 | ->ifTrue(function ($v) { return 'swift_mailer' === $v['type'] && empty($v['email_prototype']) && (empty($v['from_email']) || empty($v['to_email']) || empty($v['subject'])); }) |
523 | 542 | ->thenInvalid('The sender, recipient and subject or an email prototype have to be specified to use a SwiftMailerHandler') |
|
0 commit comments