You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/08/21 03:04:00 UTC
[jira] [Commented] (KAFKA-5755) Refactor Producer to use LogContext
[ https://issues.apache.org/jira/browse/KAFKA-5755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16134656#comment-16134656 ]
ASF GitHub Bot commented on KAFKA-5755:
---------------------------------------
GitHub user huxihx opened a pull request:
https://github.com/apache/kafka/pull/3703
KAFKA-5755: KafkaProducer should be refactored to use LogContext
With LogContext, each producer log item is automatically prefixed with client id and transactional id.
@hachikuji
Since a new parameter `logContext` is passed into `Sender` constructor which breaks the max parameter count in checkstyle, I also increased it to 14 now.
And since all the static methods where `log` is used are private in KafkaProducer, I did not check the nullness for it in those methods.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/huxihx/kafka KAFKA-5755
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/3703.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #3703
----
commit 099c2f9592fc7d137b9f08fac75017e1f00e9323
Author: huxihx <hu...@hotmail.com>
Date: 2017-08-21T02:57:31Z
KAFKA-5755: KafkaProducer should use LogContext instead of the default LoggerFactory.
With LogContext, each producer log item is automatically prefixed with client id and transactional id.
----
> Refactor Producer to use LogContext
> -----------------------------------
>
> Key: KAFKA-5755
> URL: https://issues.apache.org/jira/browse/KAFKA-5755
> Project: Kafka
> Issue Type: Improvement
> Components: producer
> Reporter: Jason Gustafson
> Labels: newbie
>
> We added a {{LogContext}} object which automatically adds a log prefix to every message written by loggers constructed from it (much like the Logging mixin available in the server code). We use this in the consumer to ensure that messages always contain the consumer group and client ids, which is very helpful when multiple consumers are run on the same instance. We should do something similar for the producer. We should always include the client id, and if one is provided, the transactional id.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)