Clog is a centralized logging system.
This is the Python client-side counterpart to clog-server for submitting log data via a JSON API.
pip install git+https://github.com/imiric/clog-py.git
import traceback
from clog_client import log
try:
1/0
except ZeroDivisionError:
log(traceback.format_exc())
You can also include some metadata about the event:
log('Exception', metadata={'id': 5})
Configuration is done via environment variables:
CLOG_HOST
: Host name or IP address to connect to. [default:"localhost"
]CLOG_PORT
: The port the server is listening on. [default:5000
]CLOG_SOURCE
: The identifier for the client's logs on the server. [default: current hostname]CLOG_TIMEOUT
: Server request timeout. [default: 1s]
Install tox and run:
$ tox