{"id":23663,"library":"eliot","title":"Eliot","description":"Eliot is a structured logging library for Python designed to capture causality in distributed systems. It allows you to log actions as trees, showing what caused what, and integrates with serialization formats like JSON. Current version 1.17.5, requires Python >=3.9.0. Maintained actively with minor releases every few months.","status":"active","version":"1.17.5","language":"python","source_language":"en","source_url":"https://github.com/itamarst/eliot","tags":["logging","structured-logging","distributed-systems"],"install":[{"cmd":"pip install eliot","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":null,"symbol":"start_action","correct":"from eliot import start_action"},{"note":"","wrong":null,"symbol":"Action","correct":"from eliot import Action"},{"note":"","wrong":null,"symbol":"log_call","correct":"from eliot import log_call"},{"note":"","wrong":null,"symbol":"Message","correct":"from eliot import Message"},{"note":"","wrong":null,"symbol":"to_file","correct":"from eliot import to_file"}],"quickstart":{"code":"import sys\nfrom eliot import start_action, to_file\n\n# Send logs to stderr\nlog_file = sys.stderr\n# If you prefer JSON to a file, use open('log.json', 'w') as f: to_file(f)\nto_file(log_file)\n\nwith start_action(action_type=\"hello\"):\n    print(\"Hello, world!\")\n    with start_action(action_type=\"inner\"):\n        pass\n","lang":"python","description":"Initialize Eliot with to_file() and use start_action context managers to log nested actions."},"warnings":[{"fix":"Use eliot.logging.bridge_logging() to bridge standard logging into Eliot, or set up Eliot as the sole logging system.","message":"Do not mix Eliot with the standard logging module unless you configure a bridge. Using both simultaneously may result in duplicate log lines or missing log entries.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Replace log_output = sys.stdout with to_file(log_output) in your initialization code. For JSON lines, use to_file(sys.stdout, format='json').","message":"Before 1.17.0, the default output was JSON lines. In 1.17.0+, the default changed to human-readable output via to_console() or to_file(). If you rely on JSON parsing, explicitly call to_file(sys.stdout) with a file-like object or set output format.","severity":"breaking","affected_versions":">=1.17.0"},{"fix":"Always use 'with start_action(...) as action:' and avoid calling start_action without entering the context.","message":"Eliot's start_action is a context manager that automatically logs the action's start and end. If you forget to use it as a context manager (e.g., not using 'with'), the action will not be logged correctly and may cause resource leaks.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Replace from eliot.parse import parse_logs with manual JSON parsing or switch to the external eliot-tree package.","message":"The 'eliot.parse' module (eliot.parse_logs) is deprecated as of 1.17.0. Use the eliot-tree CLI tool or parse logs manually with json.loads instead.","severity":"deprecated","affected_versions":">=1.17.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install eliot' to install the package.","cause":"Eliot is not installed in the current environment.","error":"ModuleNotFoundError: No module named 'eliot'"},{"fix":"Provide a file-like object, e.g., to_file(sys.stderr) or to_file(open('log.json', 'w')).","cause":"to_file() is called without providing a file-like object.","error":"TypeError: to_file() missing 1 required positional argument: 'file'"},{"fix":"Use the eliot-tree CLI tool or parse JSON lines manually with json.loads.","cause":"The parse_logs function was removed in Eliot 1.17.0.","error":"AttributeError: module 'eliot' has no attribute 'parse_logs'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}