
Python QueueHandler & QueueListener - Offload Log Processing to Separate Thread | FastAPI demo
Better Stack · 4,6 N lượt xem · 4 thg 1, 2024
Mô tả
Python's QueueHandler and QueueListener objects allow you to offload log processing to a separate thread - which can be beneficial for performance.
We'll explore these tools in this video, and how they can improve performance when using Python's SMTPHandler. We'll show a quick demo of how to use the QueueHandler in a FastAPI application.
► RELATED GUIDES
10 Best Practices for Logging in Python:
https://betterstack.com/community/gui...
Logging in Python: A Comparison of the Top 6 Libraries:
https://betterstack.com/community/gui...
► HACKING SCALE NEWSLETTER
https://newsletter.betterstack.com/
► READ MORE
More about Better Stack: https://betterstack.com/
Community pages: https://betterstack.com/community/
► STAY TUNED
GitHub: https://github.com/BetterStackHQ
Twitter: / betterstackhq
LinkedIn: / betterstack
Instagram: / betterstackhq
TikTok: / betterstack
📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro and Setup
02:31 Setting up SMTPHandler
08:35 Offloading log processing to separate thread with QueueHandler & QueueListener
13:19 FastAPI app demonstration
#fastapi #logging #python #pythonprogramming