merlimat commented on a change in pull request #1353: Have the ability to send 
log messages to a topic in Python
URL: https://github.com/apache/incubator-pulsar/pull/1353#discussion_r172756910
 
 

 ##########
 File path: pulsar-functions/instance/src/main/python/log.py
 ##########
 @@ -34,6 +34,19 @@
 # see time formatter documentation for more
 date_format = "%Y-%m-%d %H:%M:%S %z"
 
+class LogTopicHandler(logging.Handler):
+  def __init__(self, topic_name, pulsar_client):
+    Log.info("Setting up producer for log topic %s" % topic_name)
+    self.producer = pulsar_client.create_producer(
+      str(topic_name),
+      block_if_queue_full=True,
+      batching_enabled=True,
+      batching_max_publish_delay_ms=1,
 
 Review comment:
   We could use bigger timeout `10ms` or even `100ms`, since this is not 
latency sensitive, to improve efficiency.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to