Skip to content

Commit d22ca4d

Browse files
committed
Give default values for mongo database and collection.
1 parent 6dfe1fc commit d22ca4d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

DependencyInjection/Configuration.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,14 @@
5656
* - [bubble]: bool, defaults to true
5757
*
5858
* - mongo:
59-
* - mongo: {id: ...} or {host, [port], [user, pass], database, collection}
59+
* - mongo:
60+
* - id: optional if host is given
61+
* - host: database host name, optional if id is given
62+
* - [port]: defaults to 27017
63+
* - [user]: database user name
64+
* - pass: mandatory if user is present
65+
* - [database]: defaults to monolog
66+
* - [collection]: defaults to logs
6067
* - [level]: level name or int value, defaults to DEBUG
6168
* - [bubble]: bool, defaults to true
6269
*
@@ -264,8 +271,8 @@ public function getConfigTreeBuilder()
264271
->scalarNode('port')->defaultValue(27017)->end()
265272
->scalarNode('user')->end()
266273
->scalarNode('pass')->end()
267-
->scalarNode('database')->end()
268-
->scalarNode('collection')->end()
274+
->scalarNode('database')->defaultValue('monolog')->end()
275+
->scalarNode('collection')->defaultValue('logs')->end()
269276
->end()
270277
->validate()
271278
->ifTrue(function($v) {

0 commit comments

Comments
 (0)