Skip to main content

oppinionated json logger

Project description

Trustpilot Logging

Build Status Latest Version Python Support

Opinionated json logging module used by Trustpilot, ( based on python-json-logger by madzak )

Installation

Install the package from PyPI using pip:

pip install trustpilot-logging

Usage

import trustpilot_json_logging
logging = trustpilot_json_logging.setup_logging()

logging.warning("i'm alive")

# outputs
# {"message": "i'm alive", "Module": "root", "Severity": "INFO"}

Advanced Usage

import trustpilot_json_logging
logging = trustpilot_json_logging.setup_logging("INFO", sys.stderr, ignore={"elasticsearch":"WARNING"})

logging.info({
    "message": "i just arrived",
    "age": 32,
    "location": "north pole"
})

# outputs
# {"message": "i just arrived", "age": 32, "location": "north pole", "Module": "root", "Severity": "INFO"}

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 trustpilot-json-logging, version 1.0.8
Filename, size File type Python version Upload date Hashes
Filename, size trustpilot_json_logging-1.0.8-py3-none-any.whl (6.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size trustpilot-json-logging-1.0.8.tar.gz (5.5 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