chia7712 commented on code in PR #15922:
URL: https://github.com/apache/kafka/pull/15922#discussion_r1599422010
##########
log4j-appender/src/main/java/org/apache/kafka/log4jappender/KafkaLog4jAppender.java:
##########
@@ -349,8 +349,14 @@ protected Producer<byte[], byte[]>
getKafkaProducer(Properties props) {
protected void append(LoggingEvent event) {
String message = subAppend(event);
LogLog.debug("[" + new Date(event.getTimeStamp()) + "]" + message);
- Future<RecordMetadata> response = producer.send(
- new ProducerRecord<>(topic,
message.getBytes(StandardCharsets.UTF_8)));
+ Future<RecordMetadata> response;
Review Comment:
nice finding. one question: should this function log message instead of
sending data by closed producer if `closed` is true? for example:
```java
if (closed) {
LogLog.debug("sending to kafka by closed producer");
return;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]