public function prepareMessage($message)
    {
        list($text, $level, $category, $timestamp) = $message;

        $result = [
            'category' => $category,
            'level' => Logger::getLevelName($level),
            '@timestamp' => date('c', $timestamp),
        ];

        if (isset($message[4])) {
            $result['trace'] = $message[4];
        }

        //Exceptions get parsed into an array, text and arrays are passed as is, other types are var_dumped
        if ($text instanceof \Exception) {
            //convert exception to array for easier analysis
            $result['message'] = [
                'message' => $text->getMessage(),
                'file' => $text->getFile(),
                'line' => $text->getLine(),
                'trace' => $text->getTraceAsString(),
            ];
        } elseif (is_array($text) || is_string($text)) {
            $result['message'] = $text;
        } else {
            $result['message'] = VarDumper::export($text);
        }

        if ($this->includeContext) {
            $result['context'] = $this->getContextMessage();
        }

        $message = implode("\n", [
            Json::encode([
                'index' => new \stdClass()
            ]),
            Json::encode($result)
        ]);

        return $message;
    }