src/A1comms/GaeSupportLaravel/Log/JsonFormatter.php
/**
     * Normalizes given exception with or without its own stack trace based on
     * `includeStacktraces` property.
     */
Normalizes given exception with or without its own stack trace based on
`includeStacktraces` property.
Normalizes given exception with or without its own stack trace based on ` includeStacktraces ` property .
protected function normalizeException($e, $depth = 0)
    {
        $data = [
            'class' => Utils::getClass($e),
            'message' => $e->getMessage(),
            'code' => $e->getCode(),
            'file' => $e->getFile().':'.$e->getLine(),
        ];
        if ($this->includeStacktraces) {
            if ($depth > 0) {
                $trace = $e->getTrace();
                foreach ($trace as $frame) {
                    if (isset($frame['file'])) {
                        $data['trace'][] = $frame['file'].':'.$frame['line'];
                    } elseif (isset($frame['function']) && $frame['function'] === '{closure}') {
                        $data['trace'][] = $frame['function'];
                    } else {
                        $data['trace'][] = $this->normalize($frame);
                    }
                }
            } else {
                $this->message = 'EXCEPTION: (' . $data['code'] . ') ' . $data['message'] . "\n\n" . $e->getTraceAsString();
            }
        }
        if ($previous = $e->getPrevious()) {
            $data['previous'] = $this->normalizeException($previous, $depth + 1);
        }
        return $data;
    }
protected function normalizeException ( $ e , $ depth = 0 ) { $ data = [ 'class' => Utils :: getClass ( $ e ) , 'message' => $ e -> getMessage ( ) , 'code' => $ e -> getCode ( ) , 'file' => $ e -> getFile ( ) . ':' . $ e -> getLine ( ) , ] ; if ( $ this -> includeStacktraces ) { if ( $ depth > 0 ) { $ trace = $ e -> getTrace ( ) ; foreach ( $ trace as $ frame ) { if ( isset ( $ frame [ 'file' ] ) ) { $ data [ 'trace' ] [ ] = $ frame [ 'file' ] . ':' . $ frame [ 'line' ] ; } elseif ( isset ( $ frame [ 'function' ] ) && $ frame [ 'function' ] === '{closure}' ) { $ data [ 'trace' ] [ ] = $ frame [ 'function' ] ; } else { $ data [ 'trace' ] [ ] = $ this -> normalize ( $ frame ) ; } } } else { $ this -> message = 'EXCEPTION: (' . $ data [ 'code' ] . ') ' . $ data [ 'message' ] . " \n \n " . $ e -> getTraceAsString ( ) ; } } if ( $ previous = $ e -> getPrevious ( ) ) { $ data [ 'previous' ] = $ this -> normalizeException ( $ previous , $ depth + 1 ) ; } return $ data ; }
Normalizes given exception with or without its own stack trace based on
 `includeStacktraces` property.
Normalizes given exception with or without its own stack trace based on ` includeStacktraces ` property .
// We should again normalize the frames, because it might contain invalid items // We should again normalize the frames, because it might contain invalid items