コード例 #1
0
 /**
  * Process a new event into the log stream.
  *
  * @param LogEvent $event Event to process
  */
 public function processEvent(LogEvent $event)
 {
     $name = $this->levelNames[$event->level];
     print sprintf("%s [%-7s] {%s} %s\n", $event->datestring, $name, $this->contextName, $event->message);
     $expStr = implode("\n\t", $event->getExceptionBlob());
     if ($expStr) {
         print $expStr . "\n";
     }
 }
 /**
  * Process a new event into the log stream.
  *
  * @param LogEvent $event Event to process
  */
 public function processEvent(LogEvent $event)
 {
     if (in_array($event->tag, $this->tags)) {
         $date = strftime('%Y%m%dT%H%M%S', $event->timestamp);
         $filename = $this->directory . '/' . $date . '.' . $this->contextName;
         $expStr = implode('\\n\\t', $event->getExceptionBlob());
         $str = "{$event->message} | {$event->data} | {$expStr}";
         file_put_contents($filename, $str);
     }
 }