Skip to content

Instantly share code, notes, and snippets.

View lordzouga's full-sized avatar
😅

Gerald Ozojie lordzouga

😅
View GitHub Profile
@lordzouga
lordzouga / flask_logging_requests.py
Created September 17, 2023 22:51 — forked from alexaleluia12/flask_logging_requests.py
Flask Logging (every request)
#/usr/bin/python
# http://exploreflask.com/en/latest/views.html
# https://stackoverflow.com/questions/51691730/flask-middleware-for-specific-route
# https://dev.to/rhymes/logging-flask-requests-with-colors-and-structure--7g1
import logging
from logging.handlers import RotatingFileHandler
from flask import Flask, request, jsonify
from time import strftime