CRITICAL messenger Error thrown while handling message AppBundle\Message\Message

2k views Asked by At

I'm using the symfony messenger component : https://symfony.com/doc/current/messenger.html But my logs are flooded by these messages when retries are failing :

16:14:31 CRITICAL  [messenger] Error thrown while handling message AppBundle\Message\NewsletterMessage. Removing from transport after 3 retries. Error: "No newsletter subscriber found" ["message" => AppBundle\Message\NewsletterMessage^ { …},"class" => "AppBundle\Message\NewsletterMessage","retryCount" => 3,"error" => "No newsletter subscriber found","exception" => Symfony\Component\Messenger\Exception\HandlerFailedException^ { …}]

The thing is that I don't want critical messages: is there a way to change them into error messages ?

Found in the file :

Symfony\Component\Messenger\EventListener\SendFailedMessageForRetryListener

the responsible line at l.76 :

$this->logger->critical('Error thrown while handling message {class}. Removing from transport after {retryCount} retries. Error: "{error}"', $context + ['retryCount' => $retryCount, 'error' => $throwable->getMessage(), 'exception' => $throwable]);

Hope someone can help,

Thanks ! ^^

1

There are 1 answers

0
Misha_ng On

You may use failure_transport and make some logs for example https://symfony.com/doc/current/messenger.html#retries-failures