JSON logs in Python apps - with FastAPI & python-json-logger!

Published: 28 March 2024
on channel: Better Stack
2,575
98

In this video, we'll look at how to output logs in JSON format from Python applications.

We will demonstrate this with the "python-json-logger" package, and will also show how to centralize our logs by sending them to Better Stack from our application code.

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

How to Get Started with Logging in Django: 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
00:47 python-json-logger intro
01:16 Starter Project
02:39 Creating python environment
03:49 Creating FastAPI handler
09:27 Outputting logs in JSON format with python-json-logger
11:29 Sending Python logs to Better Stack
15:44 Creating FastAPI handler with a path parameter

#logging #python #pythonprogramming


On this page of the site you can watch the video online JSON logs in Python apps - with FastAPI & python-json-logger! with a duration of hours minute second in good quality, which was uploaded by the user Better Stack 28 March 2024, share the link with friends and acquaintances, this video has already been watched 2,575 times on youtube and it was liked by 98 viewers. Enjoy your viewing!