mozilla-services / python-dockerflow

A Python package to implement tools and helpers for Mozilla Dockerflow
https://python-dockerflow.readthedocs.io
Mozilla Public License 2.0
38 stars 22 forks source link

Add generic WSGI / ASGI middlewares for request logging #116

Open grahamalama opened 5 months ago

grahamalama commented 5 months ago

Each framework supported by this package has its own implementation for request.summary logging.

However, since each framework is built on server standards (WSGI / ASGI), it'd be possible to write middleware that targets these standards (WSGI, ASGI e.g.), rather than the frameworks themselves. This would make it so that this package could support any framework that's compatible with WSGI and/or ASGI.

grahamalama commented 5 months ago

~since each framework is built on server standards~

While Sanic does support being run by an ASGI server, its middleware implementation appears to be quite different from a typical ASGI-compatible middleware signature