Exemplo n.º 1
0
 /**
  * @param DomainEvent $event
  * @param EventHandlerInterface $eventHandler
  */
 public function onEventQueueingSuccess(DomainEvent $event, EventHandlerInterface $eventHandler)
 {
     $eventType = new ObjectName($event);
     $eventHandlerType = new ObjectName($eventHandler);
     $additionalData = ['status' => 'success', 'type' => 'event', 'handlerType' => $eventHandlerType->getName(), 'command' => $this->getEventData($event)];
     $this->logger->log(sprintf('%s queueing success', $eventType), LOG_INFO, $additionalData, 'ES.Event');
 }
Exemplo n.º 2
0
 /**
  * @param Message $message
  * @return array
  */
 public function serialize(Message $message)
 {
     $messageType = new ObjectName($message);
     $data = ObjectAccess::getGettableProperties($message);
     return ['messageType' => $messageType->getName(), 'payload' => $data];
 }
Exemplo n.º 3
0
 /**
  * @param Command $command
  * @param CommandHandlerInterface $commandHandler
  * @param \Exception $exception
  * @return void
  */
 public function onCommandHandlingFailure(Command $command, CommandHandlerInterface $commandHandler, \Exception $exception)
 {
     $commandHandlerType = new ObjectName($commandHandler);
     $additionalData = ['status' => 'failure', 'type' => 'command', 'handlerType' => $commandHandlerType->getName(), 'command' => $this->getCommandData($command), 'exception' => ['message' => $exception->getMessage(), 'file' => $exception->getFile(), 'class' => get_class($exception), 'line' => $exception->getLine(), 'code' => $exception->getCode()]];
     $this->logger->log(sprintf('%s handling failure', $command), LOG_ERR, $additionalData, 'ES.Command');
 }