Skip to main content

Python logger helper to log in json and redirect flask logs

Project description


A logger class that initializes a logger and logs in json when specified.
It also redirects flask logs so it doesn’t always show up as ERROR

from zonar_ds_logger.logger import logger

logger.initialize("evan-test", "info", False)
log = logger.get_logger()


Parameters that can be passed into logger.initialize are as follows:

- name (str): Name of the logger
- log_level (str): Lowest log level to log. Default is "debug". Options are "debug", "info", "warning", "error"
- json_logging (bool): Whether to log in json or not. Options that evaluate to true are ("true", "t", "1", "y", "yes")
Default converts value in JSON_LOGGING env var to bool if set else True

Project details

Download files

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

Files for zonar-ds-logger, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size zonar_ds_logger-1.0.0-py3-none-any.whl (4.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size zonar_ds_logger-1.0.0.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate 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