Skip to main content

Tiny library to push logs to `Grafana Loki` in `logfmt` format.

Project description

smoloki

Tiny library to push logs to Grafana Loki in logfmt format.

import smoloki


async def as_request_completed():
    await smoloki.push(
        {'service': 'web'},
        {'level': 'info', 'event': 'request_completed'},
    )


def as_request_completed():
    smoloki.push_sync(
        {'service': 'web'},
        {'level': 'info', 'event': 'request_completed'},
    )

Configuration

This library uses LOKI_BASE_ENDPOINT environment variable to acquire base address for requests.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smoloki-0.0.1a1.tar.gz (1.6 kB view hashes)

Uploaded Source

Built Distribution

smoloki-0.0.1a1-py3-none-any.whl (1.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page