1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-16 18:14:02 +02:00

Add Logmatic.io

This commit is contained in:
Julien Breux
2016-06-28 18:02:23 +02:00
parent 7efec0eeab
commit 996f420205
5 changed files with 276 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php declare(strict_types=1);
/*
* 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;
use Monolog\Test\TestCase;
/**
* @author Julien Breux <julien.breux@gmail.com>
*/
class LogmaticFormatterTest extends TestCase
{
/**
* @covers Monolog\Formatter\LogmaticFormatter::format
*/
public function testFormat()
{
$formatter = new LogmaticFormatter();
$formatter->setHostname('testHostname');
$formatter->setAppname('testAppname');
$record = $this->getRecord();
$formatted_decoded = json_decode($formatter->format($record), true);
$this->assertArrayHasKey('hostname', $formatted_decoded);
$this->assertArrayHasKey('appname', $formatted_decoded);
$this->assertEquals('testHostname', $formatted_decoded['hostname']);
$this->assertEquals('testAppname', $formatted_decoded['appname']);
}
}