src/Jackiedo/LogReader/LogParser.php
public function parseLogContext($content)
    {
        $content = trim($content);
        $pattern = "/^".self::CONTEXT_EXCEPTION_PATTERN.self::CONTEXT_MESSAGE_PATTERN.self::CONTEXT_IN_PATTERN."$/ms";

        preg_match($pattern, $content, $matchs);

        $exception = isset($matchs[1]) ? $matchs[1] : null;
        $message   = isset($matchs[2]) ? $matchs[3] : $content;
        $in        = isset($matchs[4]) ? $matchs[4] : null;
        $line      = isset($matchs[5]) ? $matchs[5] : null;

        return compact('message', 'exception', 'in', 'line');
    }
public function parseLogContext($content)
    {
        $content = trim($content);
        $pattern = "/^".self::CONTEXT_EXCEPTION_PATTERN.self::CONTEXT_MESSAGE_PATTERN.self::CONTEXT_IN_PATTERN."$/ms";

        preg_match($pattern, $content, $matchs);

        $exception = isset($matchs[1]) ? $matchs[1] : null;
        $message   = isset($matchs[2]) ? $matchs[3] : $content;
        $in        = isset($matchs[4]) ? $matchs[4] : null;
        $line      = isset($matchs[5]) ? $matchs[5] : null;

        return compact('message', 'exception', 'in', 'line');
    }
public function parseLogContext ( $ content ) { $ content = trim ( $ content ) ; $ pattern = "/^" . self :: CONTEXT_EXCEPTION_PATTERN . self :: CONTEXT_MESSAGE_PATTERN . self :: CONTEXT_IN_PATTERN . "$/ms" ; preg_match ( $ pattern , $ content , $ matchs ) ; $ exception = isset ( $ matchs [ 1 ] ) ? $ matchs [ 1 ] : null ; $ message = isset ( $ matchs [ 2 ] ) ? $ matchs [ 3 ] : $ content ; $ in = isset ( $ matchs [ 4 ] ) ? $ matchs [ 4 ] : null ; $ line = isset ( $ matchs [ 5 ] ) ? $ matchs [ 5 ] : null ; return compact ( 'message' , 'exception' , 'in' , 'line' ) ; }
Parses the context part of the log entry into an array containing the necessary information

@param  string  $content

@return array   Structure is ['message' => '', 'exception' => '', 'in' => '', 'line' => '']
Parses the context part of the log entry into an array containing the necessary information