4 * This file is part of the Monolog package.
6 * (c) Jordi Boggiano <j.boggiano@seld.be>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Monolog\Handler;
15 * Base Handler class providing the Handler structure
17 * Classes extending it should (in most cases) only implement write($record)
19 * @author Jordi Boggiano <j.boggiano@seld.be>
20 * @author Christophe Coevoet <stof@notk.org>
22 abstract class AbstractProcessingHandler extends AbstractHandler
27 public function handle(array $record)
29 if (!$this->isHandling($record)) {
33 $record = $this->processRecord($record);
35 $record['formatted'] = $this->getFormatter()->format($record);
37 $this->write($record);
39 return false === $this->bubble;
43 * Writes the record down to the log of the implementing handler
45 * @param array $record
48 abstract protected function write(array $record);
53 * @param array $record
56 protected function processRecord(array $record)
58 if ($this->processors) {
59 foreach ($this->processors as $processor) {
60 $record = call_user_func($processor, $record);