Merge pull request #519 from merk/logger-debug

Change logging to only be enabled in debug mode
This commit is contained in:
Tim Nagel 2014-03-26 12:42:34 +11:00
commit 8c146134da
3 changed files with 7 additions and 7 deletions

View file

@ -14,6 +14,7 @@ To generate a changelog summary since the last version, run
* 3.0.0-ALPHA3 (xxxx-xx-xx)
* a9c4c93: Logger is now only enabled in debug mode by default
* #463: allowing hot swappable reindexing
* #415: BC BREAK: document indexing occurs in postFlush rather than the pre* events previously.
* 7d13823: Dropped (broken) support for Symfony <2.3

View file

@ -121,7 +121,7 @@ class Configuration implements ConfigurationInterface
->scalarNode('host')->end()
->scalarNode('port')->end()
->scalarNode('logger')
->defaultValue('fos_elastica.logger')
->defaultValue('%kernel.debug%')
->treatNullLike('fos_elastica.logger')
->treatTrueLike('fos_elastica.logger')
->end()

View file

@ -5,8 +5,10 @@ By default, FOSElasticaBundle sets a logger against each Elastica client configu
logs all information sent to and received from Elasticsearch. This can lead to large
memory usage during population or reindexing of an index.
FOSElasticaBundle provides an option to disable a logger by setting the property on the
client configuration to false:
By default FOSElasticaBundle will only enable a logger when debug mode is enabled, meaning
in a production environment there wont be a logger enabled. To enable a logger anyway, you
can set the logger property of a client configuration to true or a service id of a logging
service you wish to use.
```yaml
# app/config/config.yml
@ -14,12 +16,9 @@ fos_elastica:
clients:
default:
host: example.com
logger: false
logger: true
```
It may be desirable to set this configuration property to `%kernel.debug%`, which would
only switch the logging capabilities of FOSElasticaBundle on when debugging is enabled.
Custom Logger Service
---------------------