/** * Serialize message to logger context * * @param MessageInterface $message * * @return array */ private function messageLoggerContext(MessageInterface $message) { return ['id' => $message->getId(), 'created' => $message->getCreated(), 'type' => $message->getType(), 'payload' => $message->getPayload()]; }
/** * {@inheritdoc} */ public function serialize(MessageInterface $message) { return json_encode(['message' => ['id' => $message->getId(), 'type' => $message->getType(), 'created' => $message->getCreated(), 'payload' => $message->getPayload()]]); }