Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

imiric/clog-py

Repository files navigation

clog-py

Clog is a centralized logging system.

This is the Python client-side counterpart to clog-server for submitting log data via a JSON API.

Setup

pip install git+https://github.com/imiric/clog-py.git

Usage

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

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]

Tests

Install tox and run:

$ tox

License

MIT

About

Centralized logging, Python client

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages