Commit f8834984 authored by Geoff Simmons's avatar Geoff Simmons

MQ plugin for Kafka: rdkafka config param log_level sets the log level for

the messaging plugin as well
parent eb52caf5
...@@ -168,8 +168,6 @@ Parameter Description ...@@ -168,8 +168,6 @@ Parameter Description
``topic`` Name of the Kafka topic to which messages ``topic`` Name of the Kafka topic to which messages
are sent (required) are sent (required)
----------------------------------- -------------------------------------------- ----------------------------------- --------------------------------------------
``mq.debug`` If set to true, then log at DEBUG level
----------------------------------- --------------------------------------------
``worker.shutdown.timeout.ms`` If non-zero, workers will wait this long ``worker.shutdown.timeout.ms`` If non-zero, workers will wait this long
before they shut down for acknowledgements before they shut down for acknowledgements
that all of the messages that they produced that all of the messages that they produced
...@@ -186,6 +184,12 @@ the ``rdkafka`` client, as documented at:: ...@@ -186,6 +184,12 @@ the ``rdkafka`` client, as documented at::
https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
The ``rdkafka`` parameter ``log_level`` sets the log level for both
the ``rdkafka`` client and the messaging plugin. Note that the value
of this parameter is a numeric syslog(3) "serverity level" (cf. RFC
5424 section 6.2.1, table 2), so INFO level is 6 (the default) and
DEBUG level is 7.
The following ``rdkafka`` parameters in the config file are ignored The following ``rdkafka`` parameters in the config file are ignored
(they are set internally by the messaging plugin, or are only relevant (they are set internally by the messaging plugin, or are only relevant
to consumers): to consumers):
......
...@@ -122,17 +122,15 @@ CONF_Add(const char *lval, const char *rval) ...@@ -122,17 +122,15 @@ CONF_Add(const char *lval, const char *rval)
return EINVAL; return EINVAL;
return(0); return(0);
} }
/* XXX: use the rdkakfka param "log_level" instead */ if (strcmp(lval, "log_level") == 0) {
if (strcmp(lval, "mq.debug") == 0) { unsigned l;
if (strcmp(rval, "1") == 0 if ((err = conf_getUnsignedInt(rval, &l)) != 0)
|| strcasecmp(rval, "true") == 0 return(err);
|| strcasecmp(rval, "yes") == 0 if (loglvl > LOG_DEBUG)
|| strcasecmp(rval, "on") == 0) return EINVAL;
loglvl = LOG_DEBUG; loglvl = l;
else if (strcmp(rval, "0") != 0 result = rd_kafka_conf_set(conf, lval, rval, errstr, LINE_MAX);
&& strcasecmp(rval, "false") != 0 if (result != RD_KAFKA_CONF_OK)
&& strcasecmp(rval, "no") != 0
&& strcasecmp(rval, "off") != 0)
return EINVAL; return EINVAL;
return(0); return(0);
} }
...@@ -156,5 +154,4 @@ CONF_Dump(void) ...@@ -156,5 +154,4 @@ CONF_Dump(void)
MQ_LOG_Log(LOG_DEBUG, "topic = %s", topic); MQ_LOG_Log(LOG_DEBUG, "topic = %s", topic);
MQ_LOG_Log(LOG_DEBUG, "worker.shutdown.timeout.ms = %u", MQ_LOG_Log(LOG_DEBUG, "worker.shutdown.timeout.ms = %u",
wrk_shutdown_timeout); wrk_shutdown_timeout);
// leaving out mq.debug for now
} }
...@@ -4,5 +4,5 @@ zookeeper.connect = localhost:2181 ...@@ -4,5 +4,5 @@ zookeeper.connect = localhost:2181
zookeeper.connection.timeout.ms = 10000 zookeeper.connection.timeout.ms = 10000
zookeeper.log = zoo.log zookeeper.log = zoo.log
topic = libtrackrdr_kafka_test topic = libtrackrdr_kafka_test
mq.debug = true log_level = 7
debug = all debug = all
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment