zendframework/zf2 — pull request #5882 by Martin-P (2014-02-27 19:53:11+00:00)
Title: Allow setting formatter for Zend\Log\Writer\Db via config options

This PR fixes issue #5881 and makes it possible to set a formatter in `Zend\Log\Writer\Db` via the config options.

The last line in `Zend\Log\Writer\Db::__construct()` ([line 90](https://github.com/zendframework/zf2/blob/master/library/Zend/Log/Writer/Db.php#L90)) always sets the formatter like this:
```php
$this->setFormatter(new DbFormatter());
```
This PR has an additional check to see if there already is a formatter set which is provided via the config options. If there already is a formatter, that formatter has precedence over the default formatter. If no formatter is provided via the config options the default formatter `Zend\Log\Formatter\Db` (`DbFormatter` in the code above) will be used.