1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-25 02:26:16 +02:00

Replaced LogglyFormatter with option to change batch formatting in JsonFormatter

This commit is contained in:
Adam Pancutt
2014-01-21 11:39:58 +00:00
parent e17aad1a99
commit 95f0649b59
4 changed files with 69 additions and 74 deletions

View File

@@ -1,36 +0,0 @@
<?php
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
/**
* Extends the standard JsonFormatter to format messages compatible with Loggly.
*
* @author Adam Pancutt <adam@pancutt.com>
*/
class LogglyFormatter extends JsonFormatter
{
/**
* {@inheritdoc}
*/
public function formatBatch(array $records)
{
$instance = $this;
array_walk($records, function(&$value, $key) use ($instance) {
$value = $instance->format($value);
});
return implode("\n", $records);
}
}