ANN: Eliot 0.9, the logging system with causality - now with journald support

Itamar Turner-Trauring itamar at
Thu Oct 8 15:04:38 CEST 2015

Eliot 0.9 is out, with a new utility for pretty-printing log messages
and native journald support [1]. You can now route Eliot logs to
journald and when an error occurs easily find all logged actions that
led up to that particular error, as opposed to most logging systems
where this would involve reading all the logs and figuring out which
ones apply and which to ignore. 

Most logging systems can tell you what happened; Eliot tells you _why_
it happened:

$ python | eliot-tree
+-- check_links at 1/started
    `-- urls: [u'', u'http://nosuchurl']
    +-- download at 2,1/started
        `-- url:
        +-- download at 2,2/succeeded
    +-- download at 3,1/started
        `-- url: http://nosuchurl
        +-- download at 3,2/failed
            |-- exception: requests.exceptions.ConnectionError
            |-- reason: ('Conn aborted', gaierror(-2, 'Name unknown'))
    +-- check_links at 4/failed
        |-- exception: exceptions.ValueError
        |-- reason: ('Conn aborted.', gaierror(-2, 'Name unknown'))

And here's the code that generated these logs (eliot-tree [2] was used
to render the output):

import sys
from eliot import start_action, to_file
import requests

def check_links(urls):
    with start_action(action_type="check_links", urls=urls):
        for url in urls:
                with start_action(action_type="download", url=url):
                    response = requests.get(url)
            except Exception as e:
                raise ValueError(str(e))

check_links([""], ["http://nosuchurl"])

Interested?

Eliot is released under the Apache License 2 by ClusterHQ [3], the
Container Data People. We're hiring! [4]


More information about the Python-announce-list mailing list