1

I am using spring boot and I am trying to get my own messages on console file if any exception occurs. But I am getting also other messages too from RabbitMQ like:

org.springframework.amqp.rabbit.support.ListenerExecutionFailedException

org.springframework.amqp.rabbit.support.ListenerExecutionFailedException: Retry Policy Exhausted

Caused by: org.springframework.amqp.AmqpRejectAndDontRequeueException: null

These are the messages which I don't want to be print on log file because it will make log file messy and contains more memory.

Is there any way to prevent from these messages to not to be printed.

  • What logging library are you using? You can configure your logs using logback, log4j, etc. Logback provides a lot of flexibility on this kind of issue. – Nora Na Nov 03 '21 at 10:04
  • I am using slf4j logger and logger factory for .info and .error messages on console. But I don't want rabbitmq to print it's own exception messages on console. and errors are those which I shown in question. – Alyan Ahmed Nov 04 '21 at 06:03
  • Is this what you are looking for? https://stackoverflow.com/questions/4972954/how-to-disable-loggers-of-a-class-or-of-whole-package – Nora Na Nov 05 '21 at 06:16

1 Answers1

0

Why are you getting this error? Maybe you need to fix that error so that this log do not appear.

But still if you want to turn off this log then add this logger in your logback.xml to turn off logging from that class

<logger name="org.springframework.amqp.rabbit.retry" level="OFF"/>
mystery
  • 875
  • 6
  • 16