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.

Source Distribution

eiq-logging-1.4.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file eiq-logging-1.4.tar.gz.

File metadata

  • Download URL: eiq-logging-1.4.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for eiq-logging-1.4.tar.gz
Algorithm Hash digest
SHA256 5b83f43f137dc872fa49ce1c0ffcea9b9625bfb32cc13f3b0d162c0bd63dcc49
MD5 ce7b2d8635d39a6a014e8cb88c314573
BLAKE2b-256 b4e4a4a2d469fd864b26b53b0b90228b0c6b1079ea7aa5994fa8228b6684ac8b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page