messa / aiohttp-request-id-logging Goto Github PK
View Code? Open in Web Editor NEWAdd [request id] to Python logging records for the Aiohttp server.
License: MIT License
Add [request id] to Python logging records for the Aiohttp server.
License: MIT License
Why not upload this to pypi? This is very inconvenient to install it using a github link.
The default request id factory returns a random string:
2020-01-15 15:58:47,238 INFO: [req:O5bvIlU] Processing GET / (__main__:hello)
2020-01-15 15:58:47,950 INFO: [req:xtMacpA] Processing GET / (__main__:hello)
Sometimes I feel like adding request counter would be better:
2020-01-15 15:58:47,238 INFO: [req:xtMac0001] Processing GET / (__main__:hello)
2020-01-15 15:58:47,950 INFO: [req:xtMac0002] Processing GET / (__main__:hello)
I want to keep some random string in the request id so it can be better searched in logs.
Also it can help when logging from multiple processes (each having their own counter) to one log file.
Maybe let's provide an alternative request id factory for this and let users configure this one instead of the default request id factory.
how to manage contextvar if middleware is in new file?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.