Skip to content

Commit

Permalink
Rename classnames to LogstashFormatter as suggested by @stof
Browse files Browse the repository at this point in the history
  • Loading branch information
timmow committed Dec 10, 2012
1 parent 32e6bff commit 6aaf70d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Monolog/Formatter/LogstashFormatter.php
Expand Up @@ -20,7 +20,7 @@
*
* @author Tim Mower <timothy.mower@gmail.com>
*/
class LogstashEventFormatter extends NormalizerFormatter
class LogstashFormatter extends NormalizerFormatter
{
/**
* @var string the name of the system for the Gelf log message
Expand Down
26 changes: 13 additions & 13 deletions tests/Monolog/Formatter/LogstashFormatterTest.php
Expand Up @@ -12,17 +12,17 @@
namespace Monolog\Formatter;

use Monolog\Logger;
use Monolog\Formatter\LogstashEventFormatter;
use Monolog\Formatter\LogstashFormatter;

class LogstashEventFormatterTest extends \PHPUnit_Framework_TestCase
class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
{

/**
* @covers Monolog\Formatter\LogstashEventFormatter::format
* @covers Monolog\Formatter\LogstashFormatter::format
*/
public function testDefaultFormatter()
{
$formatter = new LogstashEventFormatter('test');
$formatter = new LogstashFormatter('test');
$record = array(
'level' => Logger::ERROR,
'level_name' => 'ERROR',
Expand All @@ -42,19 +42,19 @@ public function testDefaultFormatter()
$this->assertEquals(Logger::ERROR, $message['@fields']['level']);
$this->assertEquals('test', $message['@source']);

$formatter = new LogstashEventFormatter('mysystem');
$formatter = new LogstashFormatter('mysystem');

$message = json_decode($formatter->format($record), true);

$this->assertEquals('mysystem', $message['@source']);
}

/**
* @covers Monolog\Formatter\LogstashEventFormatter::format
* @covers Monolog\Formatter\LogstashFormatter::format
*/
public function testFormatWithFileAndLine()
{
$formatter = new LogstashEventFormatter('test');
$formatter = new LogstashFormatter('test');
$record = array(
'level' => Logger::ERROR,
'level_name' => 'ERROR',
Expand All @@ -72,11 +72,11 @@ public function testFormatWithFileAndLine()
}

/**
* @covers Monolog\Formatter\LogstashEventFormatter::format
* @covers Monolog\Formatter\LogstashFormatter::format
*/
public function testFormatWithContext()
{
$formatter = new LogstashEventFormatter('test');
$formatter = new LogstashFormatter('test');
$record = array(
'level' => Logger::ERROR,
'level_name' => 'ERROR',
Expand All @@ -96,7 +96,7 @@ public function testFormatWithContext()
$this->assertEquals('logger', $message_array['ctxt_from']);

// Test with extraPrefix
$formatter = new LogstashEventFormatter('test', null, 'CTX');
$formatter = new LogstashFormatter('test', null, 'CTX');
$message = json_decode($formatter->format($record), true);


Expand All @@ -108,11 +108,11 @@ public function testFormatWithContext()
}

/**
* @covers Monolog\Formatter\LogstashEventFormatter::format
* @covers Monolog\Formatter\LogstashFormatter::format
*/
public function testFormatWithExtra()
{
$formatter = new LogstashEventFormatter('test');
$formatter = new LogstashFormatter('test');
$record = array(
'level' => Logger::ERROR,
'level_name' => 'ERROR',
Expand All @@ -131,7 +131,7 @@ public function testFormatWithExtra()
$this->assertEquals('pair', $message_array['key']);

// Test with extraPrefix
$formatter = new LogstashEventFormatter('test', 'EXT');
$formatter = new LogstashFormatter('test', 'EXT');
$message = json_decode($formatter->format($record), true);

$message_array = $message['@fields'];
Expand Down

0 comments on commit 6aaf70d

Please sign in to comment.