コード例 #1
0
 /**
  * Adds the actual system load to the log message context.
  *
  * @param \AppserverIo\Logger\LogMessageInterface $logMessage The log message we want to add the system load
  *
  * @return string The processed log message
  * @see \AppserverIo\Logger\Processors\ProcessorInterface::process()
  */
 public function process(LogMessageInterface $logMessage)
 {
     // load the sysload values
     $values = sys_getloadavg();
     // create an array
     $sysload = array('system_load_1' => array_shift($values), 'system_load_5' => array_shift($values), 'system_load_15' => array_shift($values));
     // merge the values with the actual context instance
     $logMessage->mergeIntoContext($sysload);
 }