protected function logException(\Exception $e, $action = null, $level = LogLevel::ERROR)
    {
        $message = $action
            ? sprintf('%s failed: %s', $action, $e->getMessage())
            : sprintf('%s: %s', get_class($e), $e->getMessage());
        $this->getLogger()->log($level, $message, ['backtrace' => $e->getTraceAsString()]);
    }
protected function logException(\Exception $e, $action = null, $level = LogLevel::ERROR)
    {
        $message = $action
            ? sprintf('%s failed: %s', $action, $e->getMessage())
            : sprintf('%s: %s', get_class($e), $e->getMessage());
        $this->getLogger()->log($level, $message, ['backtrace' => $e->getTraceAsString()]);
    }
protected function logException ( \ Exception $ e , $ action = null , $ level = LogLevel :: ERROR ) { $ message = $ action ? sprintf ( '%s failed: %s' , $ action , $ e -> getMessage ( ) ) : sprintf ( '%s: %s' , get_class ( $ e ) , $ e -> getMessage ( ) ) ; $ this -> getLogger ( ) -> log ( $ level , $ message , [ 'backtrace' => $ e -> getTraceAsString ( ) ] ) ; }
Log exception.

@param \Exception  $e      Exception.
@param string|null $action Failed action short description.
@param mixed       $level  Log level (default to LogLevel::ERROR).

@since 1.1 Default log level is LogLevel::ERROR
@since 1.0
Log exception .