You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/AbstractMessageListenerContainer.java
Copy file name to clipboardExpand all lines: spring-rabbit/src/test/java/org/springframework/amqp/rabbit/listener/SimpleMessageListenerContainerIntegration2Tests.java
Copy file name to clipboardExpand all lines: src/reference/asciidoc/amqp.adoc
+12-5
Original file line number
Diff line number
Diff line change
@@ -940,17 +940,19 @@ See <<publishing-is-async>> for one scenario where you might want to register a
940
940
941
941
Version 1.5 introduced a mechanism to enable users to control logging levels.
942
942
943
-
The `CachingConnectionFactory` uses a default strategy to log channel closures as follows:
943
+
The `AbstractConnectionFactory` uses a default strategy to log channel closures as follows:
944
944
945
945
* Normal channel closes (200 OK) are not logged.
946
-
* If a channel is closed due to a failed passive queue declaration, it is logged at debug level.
946
+
* If a channel is closed due to a failed passive queue declaration, it is logged at DEBUG level.
947
947
* If a channel is closed because the `basic.consume` is refused due to an exclusive consumer condition, it is logged at
948
-
INFO level.
948
+
DEBUG level (since 3.1, previously INFO).
949
949
* All others are logged at ERROR level.
950
950
951
951
To modify this behavior, you can inject a custom `ConditionalExceptionLogger` into the
952
952
`CachingConnectionFactory` in its `closeExceptionLogger` property.
953
953
954
+
Also, the `AbstractConnectionFactory.DefaultChannelCloseLogger` is now public, allowing it to be sub classed.
955
+
954
956
See also <<consumer-events>>.
955
957
956
958
[[runtime-cache-properties]]
@@ -2364,8 +2366,13 @@ These events can be consumed by implementing `ApplicationListener<ListenerContai
2364
2366
2365
2367
NOTE: System-wide events (such as connection failures) are published by all consumers when `concurrentConsumers` is greater than 1.
2366
2368
2367
-
If a consumer fails because one if its queues is being used exclusively, by default, as well as publishing the event, a `WARN` log is issued.
2368
-
To change this logging behavior, provide a custom `ConditionalExceptionLogger` in the `SimpleMessageListenerContainer` instance's `exclusiveConsumerExceptionLogger` property.
2369
+
If a consumer fails because one if its queues is being used exclusively, by default, as well as publishing the event, a `DEBUG` log is issued (since 3.1, previously WARN).
2370
+
To change this logging behavior, provide a custom `ConditionalExceptionLogger` in the `AbstractMessageListenerContainer` instance's `exclusiveConsumerExceptionLogger` property.
2371
+
In addition, the `SimpleMessageListenerContainer` consumer restart after such an exception is now logged at DEBUG level by default (previously INFO).
2372
+
A new method `logRestart()` has been added to the `ConditionalExceptionLogger` to allow this to be changed.
2373
+
2374
+
Also, the `AbstractMessageListenerContainer.DefaultExclusiveConsumerLogger` is now public, allowing it to be sub classed.
2375
+
2369
2376
See also <<channel-close-logging>>.
2370
2377
2371
2378
Fatal errors are always logged at the `ERROR` level.
This version requires Spring Framework 6.1 and Java 17.
9
9
10
+
[[31-exc]]
11
+
==== Exclusive Consumer Logging
12
+
13
+
Log messages reporting access refusal due to exclusive consumers are now logged at DEBUG level by default.
14
+
It remains possible to configure your own logging behavior by setting the `exclusiveConsumerExceptionLogger` and `closeExceptionLogger` properties on the listener container and connection factory respectively.
15
+
In addition, the `SimpleMessageListenerContainer` consumer restart after such an exception is now logged at DEBUG level by default (previously INFO).
16
+
A new method `logRestart()` has been added to the `ConditionalExceptionLogger` to allow this to be changed.
17
+
See <<consumer-events>> and <<channel-close-logging>> for more information.
0 commit comments