protected function getLogAsObject($level, $message)
    {
        $log = new Entity;
        $log->level = $level;
        $log->datetime = date('Y-m-d H:i:s');

        //Sets exception type and message
        if (preg_match('/^(\[([^\]]+)\]\s)?(.+)/', $message, $matches)) {
            if (!empty($matches[2])) {
                $log->exception = $matches[2];
            }

            $log->message = $matches[3];
        }

        //Sets the exception attributes
        if (preg_match(
            '/Exception Attributes:\s((.(?!Request URL|Referer URL|Client IP|Stack Trace|Trace))+)/is',
            $message,
            $matches
        )) {
            $log->attributes = $matches[1];
        }

        //Sets the request URL
        if (preg_match('/^Request URL:\s(.+)$/mi', $message, $matches)) {
            $log->request = $matches[1];
        }

        //Sets the referer URL
        if (preg_match('/^Referer URL:\s(.+)$/mi', $message, $matches)) {
            $log->referer = $matches[1];
        }

        //Sets the client IP
        if (preg_match('/^Client IP:\s(.+)$/mi', $message, $matches)) {
            $log->ip = $matches[1];
        }

        //Sets the trace
        if (preg_match('/(Stack )?Trace:\n(.+)$/is', $message, $matches)) {
            $log->trace = trim($matches[2]);
        }

        //Adds the full log
        $log->full = trim(sprintf('%s %s: %s', date('Y-m-d H:i:s'), ucfirst($level), $message));

        return $log;
    }