protected function formatParams($message, $context)
    {
        if (!is_array($context)) {
            $context = array('context' => $context);
        }
        if ($message instanceof \Exception) {
            $context += array(
                'code' => $message->getCode(),
                'file' => $message->getFile(),
                'line' => $message->getLine(),
                'trace' => $message->getTraceAsString(),
            );
            $message = $message->getMessage();
        } elseif (is_array($message)) {
            $message = print_r($message, true);
        } else {
            $message = (string)$message;
        }
        return array('message' => $message, 'context' => $context);
    }
protected function formatParams($message, $context)
    {
        if (!is_array($context)) {
            $context = array('context' => $context);
        }
        if ($message instanceof \Exception) {
            $context += array(
                'code' => $message->getCode(),
                'file' => $message->getFile(),
                'line' => $message->getLine(),
                'trace' => $message->getTraceAsString(),
            );
            $message = $message->getMessage();
        } elseif (is_array($message)) {
            $message = print_r($message, true);
        } else {
            $message = (string)$message;
        }
        return array('message' => $message, 'context' => $context);
    }
protected function formatParams ( $ message , $ context ) { if ( ! is_array ( $ context ) ) { $ context = array ( 'context' => $ context ) ; } if ( $ message instanceof \ Exception ) { $ context += array ( 'code' => $ message -> getCode ( ) , 'file' => $ message -> getFile ( ) , 'line' => $ message -> getLine ( ) , 'trace' => $ message -> getTraceAsString ( ) , ) ; $ message = $ message -> getMessage ( ) ; } elseif ( is_array ( $ message ) ) { $ message = print_r ( $ message , true ) ; } else { $ message = ( string ) $ message ; } return array ( 'message' => $ message , 'context' => $ context ) ; }
Convert message to string and content to array for writing

@param string|\Exception $message
@param string|array $context
@return array
Convert message to string and content to array for writing