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_r172757186
 
 

 ##########
 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,
+      max_pending_messages=100000)
 
 Review comment:
   100K messages could mean a lot of memory to buffer up, I'd stick with 
default 1K unless there are specific needs

----------------------------------------------------------------
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