src/Log/LogFormatter.php
public function formatLog(array $logMessage) {
        extract($logMessage);

        $level = strtoupper($level);
        $message = $this->applyContext($message, $context);
        $timestamp = date($this->dateTimeFormat, $timestamp);
        $exception = $this->getExceptionTrace($context);

        $log = str_replace(self::FORMAT_TIMESTAMP, $timestamp, $this->logFormat);
        $log = str_replace(self::FORMAT_LEVEL, $level, $log);
        $log = str_replace(self::FORMAT_MESSAGE, $message, $log);
        $log = str_replace(self::FORMAT_EXCEPTION, $exception, $log);

        return $log;
    }
public function formatLog(array $logMessage) {
        extract($logMessage);

        $level = strtoupper($level);
        $message = $this->applyContext($message, $context);
        $timestamp = date($this->dateTimeFormat, $timestamp);
        $exception = $this->getExceptionTrace($context);

        $log = str_replace(self::FORMAT_TIMESTAMP, $timestamp, $this->logFormat);
        $log = str_replace(self::FORMAT_LEVEL, $level, $log);
        $log = str_replace(self::FORMAT_MESSAGE, $message, $log);
        $log = str_replace(self::FORMAT_EXCEPTION, $exception, $log);

        return $log;
    }
public function formatLog ( array $ logMessage ) { extract ( $ logMessage ) ; $ level = strtoupper ( $ level ) ; $ message = $ this -> applyContext ( $ message , $ context ) ; $ timestamp = date ( $ this -> dateTimeFormat , $ timestamp ) ; $ exception = $ this -> getExceptionTrace ( $ context ) ; $ log = str_replace ( self :: FORMAT_TIMESTAMP , $ timestamp , $ this -> logFormat ) ; $ log = str_replace ( self :: FORMAT_LEVEL , $ level , $ log ) ; $ log = str_replace ( self :: FORMAT_MESSAGE , $ message , $ log ) ; $ log = str_replace ( self :: FORMAT_EXCEPTION , $ exception , $ log ) ; return $ log ; }
Format log message
@param  array  $logMessage An array with key `timestamp`, 'level', 'message', and 'context'
@return string
Format log message