Skip to main content

Consistent logging for EIQ projects.

Project description

eiq_logging

This package exists to make it easy to configure logging in a consistent way across multiple EclecticIQ Python projects.

Installation

pip install eiq-logging

Usage

In your application's entrypoint, whatever that may be:

import eiq_logging
eiq_logging.configure()

The configure function takes a few arguments:

  • stream determines where logs are written. Defaults to sys.stderr.
  • log_format can be either "plain" or "json". "plain" means plain text and is meant to be read by humans. "json" is newline-delimited JSON, meant for log aggregation and machine parsing.
  • log_levels can be either a dict of {logger_name: log_level} or a string which will be parsed as such. The string is comma-separated, and each item in the string should be in the format of "logger_name:log_level" - for example, root:info,example:debug will set the root logger to the level INFO, and the logger "example" to level DEBUG.

If you leave out the log_format and log_level arguments, you can configure these through the environment variables EIQ_LOG_FORMAT and EIQ_LOG_LEVEL.

If you're using Gunicorn, you don't need to call configure yourself, you can just start the process with the --config flag:

gunicorn --config=python:eiq_logging.gunicorn myapp

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 eiq-logging, version 1.4
Filename, size File type Python version Upload date Hashes
Filename, size eiq-logging-1.4.tar.gz (5.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page