protected function getCallback(): callable
    {
        if ($this->callback === null) {
            $this->callback = function (LogInterface $log): array {
                $metaData = $log->getMetaData() ?: null;
                if (is_array($metaData) === true) {
                    $metaData = json_encode($metaData, JSON_PARTIAL_OUTPUT_ON_ERROR | JSON_UNESCAPED_SLASHES);
                }

                $priority = $log->getPriority();

                return [
                    'value' => $priority->getValue(),
                    'keyword' => strtoupper($priority->getKeyword()),
                    'date_time' => $log->getDateTime()->format('Y-m-d H:i:s'),
                    'message' => $log->getMessage(),
                    'meta_data' => $metaData,
                ];
            };
        }

        return $this->callback;
    }