{ "info": { "author": "Nethunters Dev", "author_email": "dev@nethunters.co.uk", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Flask", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Flask-Web-Log\nFlask-Web-Log enables request logging for your flask app. It has support for multiple\n\n\n## Features\nThe following useful request data is logged (full explanations are in the [Flask docs](https://flask.palletsprojects.com/en/1.0.x/api/#flask.Request)):\n- time: Date and Time in ISO 8601 format\n- src_ip: Source IP, has support for 'X-Forwarded-For'\n- useragent: Client UserAgent\n- connection: Connection Type e.g. keep-alive, close\n- http_method: HTTP method e.g. GET, POST OPTIONS\n- request_scheme: URL scheme (http or https).\n- http_status: HTTP status code e.g. 200, 301, 404\n- dest_ip: Destination host IP\n- dest_port: Destination host port\n- url: URL requested\n- url_path: URL path requested\n- content_type: indicates the media type of the entity-body\n- mimetype: similar to content type but without parameters e.g. if the content type is text/HTML; charset=utf-8 the mimetype would be 'text/html'.\n- url_query: raw URL query string\n- cookies: A dictionary with the contents of all cookies transmitted with the request.\n- data: Contains the incoming request data as string in case it came with a mimetype Werkzeug does not handle.\n- content_md5: MD5 digest of the entity-body for the purpose of providing an end-to-end message integrity check (MIC) of the entity-body.\n- referrer: URL referrer\n- authorisation: HTTP basic/digest authorization header\n- duration - Request duration from the time the request was received to the time the request was replied to\n- request_id: Correlates HTTP requests between the client and server.\n- user(remote_user): If the server supports user authentication, and the script is protected, this attribute contains the username the user has authenticated as.\n\n\nFlask-Web-Log can log requests to the following formats:\n- CSV\n- JSON\n- SQLITE DB\n- STDOUT\n\n## Installation\n\nYou can install Flask-Web-Log using pip:\n```bash\npip install flask_web_log\n```\nor directly from source:\n```bash\ngit clone git@github.com:nethunters/flask-web-log.git\ncd flask-web-log\npython setup.py install\n```\n\n## Quickstart\nImport flask_web_log and initialise.\n```python\nfrom flask_web_log import Log\nLog(app)\n```\n\n## Example App\n```python\nfrom flask import Flask, request, Response\nfrom flask_web_log import Log\n\napp = Flask(__name__)\napp.config[\"LOG_TYPE\"] = \"CSV\"\nLog(app)\n\n\n@app.route('/', methods=[\"GET\", \"POST\"])\ndef hello():\n return \"lets test this log!\"\n\n\nif __name__ == '__main__':\n app.run(debug=True)\n\n```\n\n## Configuration\nThe following configuration values are used by Flask-Web-Log:\n\n| Config Value \t| Description \t|\n|---------------\t|--------------------------------------------------------------------------------------------------------\t|\n| LOG_TYPE \t| Format to log out to. Currently supported log formats are: CSV, JSON, STDOUT and SQLITE DB. Defaults to `CSV`. \t| \t|\n| LOG_FILENAME \t| The filename, without the file extension, for the log. Defaults to `flask-web-log`. \t|\n| LOG_LOCATION \t| The directory to log to. Defaults to the current directory. \t|\n\n## License\nFlask-Web-Log is licensed under the Apache2.0 license. See [License](https://github.com/nethunterslabs/flask-web-log/blob/master/LICENSE).", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/nethunterslabs/flask-web-log/archive/0.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nethunterslabs/flask-web-log", "keywords": "", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "Flask-Web-Log", "package_url": "https://pypi.org/project/Flask-Web-Log/", "platform": "any", "project_url": "https://pypi.org/project/Flask-Web-Log/", "project_urls": { "Download": "https://github.com/nethunterslabs/flask-web-log/archive/0.1.tar.gz", "Homepage": "https://github.com/nethunterslabs/flask-web-log" }, "release_url": "https://pypi.org/project/Flask-Web-Log/0.1/", "requires_dist": null, "requires_python": "", "summary": "Enables web traffic and request logs for your Flask app.", "version": "0.1" }, "last_serial": 5564284, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "483394fd5aedd217791fbd8bc4d93870", "sha256": "af57fdbb1d95111110d797660baf8fa15f2a2d2e409b521840998892cd438fc5" }, "downloads": -1, "filename": "Flask-Web-Log-0.1.tar.gz", "has_sig": false, "md5_digest": "483394fd5aedd217791fbd8bc4d93870", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4793, "upload_time": "2019-07-21T19:23:48", "url": "https://files.pythonhosted.org/packages/75/0c/fdf82cfa6734834356785ebe0a46287e6cf9c883230395731a24d8287297/Flask-Web-Log-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "483394fd5aedd217791fbd8bc4d93870", "sha256": "af57fdbb1d95111110d797660baf8fa15f2a2d2e409b521840998892cd438fc5" }, "downloads": -1, "filename": "Flask-Web-Log-0.1.tar.gz", "has_sig": false, "md5_digest": "483394fd5aedd217791fbd8bc4d93870", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4793, "upload_time": "2019-07-21T19:23:48", "url": "https://files.pythonhosted.org/packages/75/0c/fdf82cfa6734834356785ebe0a46287e6cf9c883230395731a24d8287297/Flask-Web-Log-0.1.tar.gz" } ] }