Beispiel #1
0
 public function testProcess()
 {
     $processor = new RequestId();
     $event = array('timestamp' => '', 'priority' => 1, 'priorityName' => 'ALERT', 'message' => 'foo', 'extra' => array());
     $eventA = $processor->process($event);
     $this->assertArrayHasKey('requestId', $eventA['extra']);
     $eventB = $processor->process($event);
     $this->assertArrayHasKey('requestId', $eventB['extra']);
     $this->assertEquals($eventA['extra']['requestId'], $eventB['extra']['requestId']);
 }
Beispiel #2
0
 /**
  * Processes a log message before it is given to the writers
  *
  * @param  array $event
  *
  * @return array
  */
 public function process(array $event)
 {
     $event = parent::process($event);
     $event['uniqueId'] = substr($event['extra']['requestId'], 0, 7);
     return $event;
 }