Skip to content

Commit 62046c2

Browse files
garyrussellartembilan
authored andcommitted
GH-1659: Only Log Record Metadata true by default
Resolves #1659
1 parent 8276b6c commit 62046c2

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

spring-kafka/src/main/java/org/springframework/kafka/listener/ConsumerProperties.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public class ConsumerProperties {
9797

9898
private LogIfLevelEnabled.Level commitLogLevel = LogIfLevelEnabled.Level.DEBUG;
9999

100-
private boolean onlyLogRecordMetadata;
100+
private boolean onlyLogRecordMetadata = true;
101101

102102
private Properties kafkaConsumerProperties = new Properties();
103103

@@ -372,9 +372,9 @@ public boolean isOnlyLogRecordMetadata() {
372372
}
373373

374374
/**
375-
* Set to true to only log {@code topic-partition@offset} in log messages instead
376-
* of {@code record.toString()}.
377-
* @param onlyLogRecordMetadata true to only log the topic/parrtition/offset.
375+
* Set to false to log {@code record.toString()} in log messages instead
376+
* of {@code topic-partition@offset}.
377+
* @param onlyLogRecordMetadata false to log the entire record.
378378
* @since 2.2.14
379379
*/
380380
public void setOnlyLogRecordMetadata(boolean onlyLogRecordMetadata) {

spring-kafka/src/test/java/org/springframework/kafka/listener/KafkaMessageListenerContainerTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,6 @@ public void testRecordAckAfterRecoveryMock() throws Exception {
668668
containerProps.setGroupId("grp");
669669
containerProps.setAckMode(AckMode.RECORD);
670670
containerProps.setMissingTopicsFatal(false);
671-
containerProps.setOnlyLogRecordMetadata(true);
672671
final CountDownLatch latch = new CountDownLatch(2);
673672
MessageListener<Integer, String> messageListener = spy(
674673
new MessageListener<Integer, String>() { // Cannot be lambda: Mockito doesn't mock final classes

src/reference/asciidoc/kafka.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2403,7 +2403,7 @@ See `monitorInterval`.
24032403
|onlyLogRecord
24042404
Metadata
24052405
|`false`
2406-
|Set to true to show only the `topic-partition@offset` for a record instead of the whole consumer record (in error, debug logs etc).
2406+
|Set to false to log the complete consumer record (in error, debug logs etc) instead of just `topic-partition@offset`.
24072407

24082408
|pollTimeout
24092409
|5000

src/reference/asciidoc/whats-new.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@ For changes in earlier version, see <<history>>.
77
==== Kafka Client Version
88

99
This version requires the 2.7.0 `kafka-clients`.
10+
11+
[[x27-container]]
12+
==== Listener Container Changes
13+
14+
The `onlyLogRecordMetadata` container property is now `true` by default.
15+
See <<container-props>> for more information.

0 commit comments

Comments
 (0)