Skip to content

Commit bfb07df

Browse files
soxofaanedenhill
authored andcommitted
Minor doc fix: logging configuration code example
1 parent 2390427 commit bfb07df

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/index.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ The Python bindings also provide some additional configuration properties:
142142
provided ``logging.Handler`` instance.
143143
To avoid spontaneous calls from non-Python threads the log messages
144144
will only be forwarded when ``client.poll()`` or ``producer.flush()`` are called.
145+
For example::
146+
147+
mylogger = logging.getLogger()
148+
mylogger.addHandler(logging.StreamHandler())
149+
producer = confluent_kafka.Producer({'bootstrap.servers': 'mybroker.com'}, logger=mylogger)
145150

146-
mylogger = logging.getLogger()
147-
mylogger.addHandler(logging.StreamHandler())
148-
producer = confluent_kafka.Producer({'bootstrap.servers': 'mybroker.com'}, logger=mylogger)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy