Skip to main content

flask_easylog extension for flask application

Project description


help log management for flask application


pip install flask-easylog


git clone
cd flask-easylog
python install

You can load test by

python -m unittest discover -s test


from flask import Flask, request, current_app
from logging import DEBUG, INFO, ERROR

from flask_easylog import EasyLog, FMT_ACCESS_LOG, log, SpecificLevelLog, Api, Ui

app = Flask(__name__)
app.secret_key = 'super secret string'
app.logger.setLevel(INFO)"before add EasyLog")

    fmt = FMT_ACCESS_LOG,
    afterlog = True,
    beforelog = True)
app.register_blueprint(Ui(url_prefix='/ui'))"after add EasyLog")

def hello():
    current_app.logger.critical("critical from hello")
    current_app.logger.error("error from hello")"info from hello")
    current_app.logger.debug("debug from hello")
    return "Hello World!"

def one():
    current_app.logger.critical("critical from one")
    current_app.logger.error("error from one")"info from one")
    current_app.logger.debug("debug from one")
    return "Hello World!"

def two():
    current_app.logger.critical("critical from two")
    current_app.logger.error("error from two")"info from two")
    current_app.logger.debug("debug from two")
    return "Hello World!"

def three():
    current_app.logger.critical("critical from three")
    current_app.logger.error("error from three")"info from three")
    current_app.logger.debug("debug from three")
    return "Hello World!"

def four():
    current_app.logger.critical("critical from four")
    current_app.logger.error("error from four")"info from four")
    current_app.logger.debug("debug from four")
    return "Hello World!"


if __name__ == "__main__":"before run")"", port=8080)


  • manage request too long by Filter and @
  • manage level by rule (change by api)
  • change work of print function
  • test access.log with goaccess
  • add fct for debug if status >= 500 and not mode debug

V. 0.1.0

  • init
  • add request_id
  • add info from config and request
  • add info timestamp

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for flask-easylog, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size flask-easylog-1.0.0.tar.gz (11.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page