コード例 #1
0
 /**
  * Formats and returns a string representation of the passed log message.
  *
  * @param \AppserverIo\Logger\LogMessageInterface $logMessage The log message we want to format
  *
  * @return string The formatted string representation for the log messsage
  */
 public function format(LogMessageInterface $logMessage)
 {
     // initialize the parameters for the formatted message
     $params = array(date($this->dateFormat), gethostname(), $logMessage->getLevel(), $logMessage->getMessage(), json_encode($logMessage->getContext()));
     // format, trim and return the message
     return trim(vsprintf($this->messageFormat, $params));
 }