Skip to main content

Eliot: Logging as Storytelling

Coveralls test coverage information Build Status

Eliot provides a structured logging and tracing system for Python that generates log messages describing a forest of nested actions. Actions start and eventually finish, successfully or not. Log messages thus tell a story: what happened and what caused it.

Here’s what your logs might look like before using Eliot:

Going to validate http://example.com/index.html.
Started download attempted.
Download succeeded!
Missing <title> element in "/html/body".
Bad HTML entity in "/html/body/p[2]".
2 validation errors found!

After switching to Eliot you’ll get a tree of messages with both message contents and causal relationships encoded in a structured format:

  • {"action_type": "validate_page", "action_status": "started", "url": "http://example.com/index.html"}

    • {"action_type": "download", "action_status": "started"}

    • {"action_type": "download", "action_status": "succeeded"}

    • {"action_type": "validate_html", "action_status": "started"}

      • {"message_type": "validation_error", "error_type": "missing_title", "xpath": "/html/head"}

      • {"message_type": "validation_error", "error_type": "bad_entity", "xpath": "/html/body/p[2]"}

    • {"action_type": "validate_html", "action_status": "failed", "exception": "validator.ValidationFailed"}

  • {"action_type": "validate_page", "action_status": "failed", "exception": "validator.ValidationFailed"}

Features:

  • Structured, typed log messages.

  • Ability to log actions, not just point-in-time information: log messages become a trace of program execution.

  • Excellent support for unit testing your code’s logging.

  • Emphasis on performance, including no blocking I/O in logging code path.

  • Optional Twisted support.

  • Designed for JSON output, usable by Logstash/Elasticsearch.

  • Supports CPython 2.7, 3.3, 3.4 and PyPy.

  • Eliot APIs provide both PEP 8 style (e.g. write_traceback()) and Twisted (e.g. writeTraceback()) method and function names. The only exceptions are pyunit-style assertions (e.g. assertContainsFields()) and Twisted-specific APIs since both use camelCase by default.

Eliot is released by ClusterHQ under the Apache 2.0 License.

To install:

$ pip install eliot

Downloads are available on PyPI.

Documentation can be found on Read The Docs.

Bugs and feature requests should be filed at the project Github page.

You can ask for help on IRC at the #eliot channel on irc.freenode.net.

Metadata

Release files for eliot 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eliot 0.5.0
File Size Uploaded
eliot-0.5.0.tar.gz 81.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for eliot 0.5.0
File Interpreter ABI Platform
eliot-0.5.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 139.6 kB

Release files / eliot-0.5.0.tar.gz

Download URL eliot-0.5.0.tar.gz
Size 81.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a2ed72013584222073481d333b029efdfba938326d36e1a753a8fd5064cbdef4
BLAKE2b-256 checksum
How to use checksums
23d71611f74a1ccad816752d9f520252d4ed4eb8fd3d72b0912170d259c170a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / eliot-0.5.0-py2.py3-none-any.whl

Download URL eliot-0.5.0-py2.py3-none-any.whl
Size 58.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ca182e4fc907779f5aecbdc56ce49c4bdde135a1d01d3853432c496f81196335
BLAKE2b-256 checksum
How to use checksums
c96f378b6dfe4c9f26846032e8de5232e004c545e3a69ef80723857892342a77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.17.5

2 release files

1.16.0

2 release files

1.15.0

1 release file

1.14.0

2 release files

1.13.0

2 release files

1.12.0

2 release files

1.10.0

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.6.0

2 release files

This release

0.5.0 This release

2 release files

0.4.0

1 release file

0.3.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page