Skip to content

Commit 62130dc

Browse files
committed
The mongo configuration has to be specified to use a MongoHandler
1 parent d22ca4d commit 62130dc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

DependencyInjection/Configuration.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@
5656
* - [bubble]: bool, defaults to true
5757
*
5858
* - mongo:
59-
* - mongo:
60-
* - id: optional if host is given
59+
* - mongo:
60+
* - id: optional if host is given
6161
* - host: database host name, optional if id is given
6262
* - [port]: defaults to 27017
6363
* - [user]: database user name
64-
* - pass: mandatory if user is present
64+
* - pass: mandatory only if user is present
6565
* - [database]: defaults to monolog
6666
* - [collection]: defaults to logs
6767
* - [level]: level name or int value, defaults to DEBUG
@@ -480,6 +480,10 @@ public function getConfigTreeBuilder()
480480
->ifTrue(function($v) { return 'cube' === $v['type'] && empty($v['url']); })
481481
->thenInvalid('The url has to be specified to use a CubeHandler')
482482
->end()
483+
->validate()
484+
->ifTrue(function($v) { return 'mongo' === $v['type'] && !isset($v['mongo']); })
485+
->thenInvalid('The mongo configuration has to be specified to use a MongoHandler')
486+
->end()
483487
->validate()
484488
->ifTrue(function($v) { return 'amqp' === $v['type'] && empty($v['exchange']); })
485489
->thenInvalid('The exchange has to be specified to use a AmqpHandler')

0 commit comments

Comments
 (0)