Flask-Log
This is a handy flask extension for setting up logging for your application that is super simple to setup. A basic example is:
import flask
from flask.ext.log import Logging
app = flask.Flask(__name__)
app.config['FLASK_LOG_LEVEL'] = 'DEBUG'
flask_log = Logging(app)
app.logger.debug('Testing a debug message')
So the level of logging is configurable through regular flask configuration methods. Additionally, since we are setting up the root logger, you can use whatever logger you want as you aren’t restricted to the flask application logger. i.e. something like:
import logging
log = logging.getLogger('my-special-logger')
log.critical('Oh my!')
will also keep the formatter and level if the extensions has been initialized anywhere.
Features
Sets up syslog handling to either /dev/log, /var/run/syslog, or 127.0.0.1 on UDP port 514 depending on what is available.
Adds a log formatter packed with information and by default produces output like: [2015-03-31 18:10:17,816] CRITICAL 42282 [__main__] example.py:7 - [my_hostname] - Hi
Full code coverage
The log formatter can be overidden with something like:
flask_logger = Logging(app) flask_logger.set_formatter('Log message follows: %(message)s')
Links
Metadata
Release files for flask-log 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flask-log-0.1.0.tar.gz | 4.0 kB | Without provenance | Details for flask-log-0.1.0.tar.gz |
Release files / flask-log-0.1.0.tar.gz
| Download URL | flask-log-0.1.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e708570519f8c50d12b398c0c49a43e1c69b4298dae28c326a7aa4becad5a44c
|
|
BLAKE2b-256 checksum How to use checksums |
b464b0907045c9cf0f8850118739e3b3061a546dae2a6fafd3e6c26e594eaba8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for flask-log 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.