src/Components/Notifier.php
public function send(Exception $e, array $context = [])
    {
        if ($this->shouldntHandle($e)) {
            return false;
        }

        $message = $this->getMessage($e);
        $subject = $this->getSubject($e);
        $context = $this->getContext($e, $context);
        
        try {
            $notify = new Notify($this->config, $this->log, $subject);
            
            $level = (array_key_exists('log_level', $this->config) && !empty($this->config['log_level']))
            ? $this->config['log_level']
            : 'critical';
            
            $notify->{$level}($message, $context);

            Cache::forever($this->getCacheKey($e), Carbon::now());
            
            return true;
        } catch (Exception $e) {
            $code = (is_int($e->getCode()) ? $e->getCode() : 0);
            throw new NotifierFailedException($e->getMessage(), $code, $e);
        }
    }
public function send(Exception $e, array $context = [])
    {
        if ($this->shouldntHandle($e)) {
            return false;
        }

        $message = $this->getMessage($e);
        $subject = $this->getSubject($e);
        $context = $this->getContext($e, $context);
        
        try {
            $notify = new Notify($this->config, $this->log, $subject);
            
            $level = (array_key_exists('log_level', $this->config) && !empty($this->config['log_level']))
            ? $this->config['log_level']
            : 'critical';
            
            $notify->{$level}($message, $context);

            Cache::forever($this->getCacheKey($e), Carbon::now());
            
            return true;
        } catch (Exception $e) {
            $code = (is_int($e->getCode()) ? $e->getCode() : 0);
            throw new NotifierFailedException($e->getMessage(), $code, $e);
        }
    }
public function send ( Exception $ e , array $ context = [ ] ) { if ( $ this -> shouldntHandle ( $ e ) ) { return false ; } $ message = $ this -> getMessage ( $ e ) ; $ subject = $ this -> getSubject ( $ e ) ; $ context = $ this -> getContext ( $ e , $ context ) ; try { $ notify = new Notify ( $ this -> config , $ this -> log , $ subject ) ; $ level = ( array_key_exists ( 'log_level' , $ this -> config ) && ! empty ( $ this -> config [ 'log_level' ] ) ) ? $ this -> config [ 'log_level' ] : 'critical' ; $ notify -> { $ level } ( $ message , $ context ) ; Cache :: forever ( $ this -> getCacheKey ( $ e ) , Carbon :: now ( ) ) ; return true ; } catch ( Exception $ e ) { $ code = ( is_int ( $ e -> getCode ( ) ) ? $ e -> getCode ( ) : 0 ) ; throw new NotifierFailedException ( $ e -> getMessage ( ) , $ code , $ e ) ; } }
Triggers the Monolog Logger instance to log an error to all handlers
@param  Exception $e The exception to use
@param  array $context Additional information that you would like to pass to Monolog
@return bool
@throws NotifierFailedException
Triggers the Monolog Logger instance to log an error to all handlers