Skip to main content

A simple logging library with JSON log formatting

Project description

Logtron

Release Downloads Supported Versions License

Build Coverage Documentation Maintainability Tech Debt Issues

Logtron is a simple logging library with JSON log formatting.

>>> import logtron
>>> logger = logtron.autodiscover()
>>> logger.info("hello world")
{"timestamp": 1598900664859, "message": "hello world", "name": "root", "level": 20, "context": {}, "extra": {}}
>>> logger.info("extra args", extra={"foo": "bar", "count": 7})
{"timestamp": 1598900667704, "message": "extra args", "name": "root", "level": 20, "context": {}, "extra": {"foo": "bar", "count": 7}}
>>>

Or

>>> import logtron
>>> logtron.autodiscover() # Only needs to run once somewhere to configure the root logger
<RootLogger root (INFO)>
>>>
>>> import logging
>>> logger = logging.getLogger()
>>> logger.info("hello world")
{"timestamp": 1598900735699, "message": "hello world", "name": "root", "level": 20, "context": {}, "extra": {}}
>>> logger.info("extra args", extra={"foo": "bar", "count": 7})
{"timestamp": 1598900757238, "message": "extra args", "name": "root", "level": 20, "context": {}, "extra": {"foo": "bar", "count": 7}}
>>>

Logtron allows you to skip all the usual boilerplate when configuring python logging.

Logtron will default to a console JSON log formatter that is compatible with popular log aggregators such as Logstash, Fluent Bit, or AWS CloudWatch Logs.

Installing Logtron and Supported Versions

Logtron is available on PyPI:

$ python -m pip install logtron

Logtron officially supports Python 2.7 & 3.5+.

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

logtron-0.1.10.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

logtron-0.1.10-py2.py3-none-any.whl (10.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file logtron-0.1.10.tar.gz.

File metadata

  • Download URL: logtron-0.1.10.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.0 Linux/4.15.0-1077-gcp

File hashes

Hashes for logtron-0.1.10.tar.gz
Algorithm Hash digest
SHA256 b4264f1bc8401971196dd89e82e020fb0a25b6ca9c898f16f70681e5b54db3b3
MD5 b2edeff249bd151f92c2ce7567382bc8
BLAKE2b-256 6eb2ec5914997d6c19b076b0cdfca9d7a6089e3f89ca93640b0de96ced5919f6

See more details on using hashes here.

File details

Details for the file logtron-0.1.10-py2.py3-none-any.whl.

File metadata

  • Download URL: logtron-0.1.10-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.0 Linux/4.15.0-1077-gcp

File hashes

Hashes for logtron-0.1.10-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ad1671e0226c6bafb3ebeb9cc47a9f633f76e9897728ed47bdcd9bf6ae9d6be3
MD5 f650d8acad46f833d4a1b0b71e097ce6
BLAKE2b-256 903e7f5786529328a98afed84a09837e658cdaacc85bf0b0f13ce74ce398dc82

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