public function testFormatWithApplicationName() { $formatter = new LogstashFormatter('app', 'test'); $record = array('level' => Logger::ERROR, 'level_name' => 'ERROR', 'channel' => 'meh', 'context' => array('from' => 'logger'), 'datetime' => new \DateTime("@0"), 'extra' => array('key' => 'pair'), 'message' => 'log'); $message = json_decode($formatter->format($record), true); $this->assertArrayHasKey('@type', $message); $this->assertEquals('app', $message['@type']); }
public function __construct($applicationName, $systemName = null, $extraPrefix = null, $contextPrefix = '') { parent::__construct($applicationName, $systemName = null, $extraPrefix = null, $contextPrefix = '', $version = self::V1); }