Skip to main content

An asynchronous python logging handler to stream logs to Grafana Loki

Project description

aioloki

An asynchronous python logging handler to stream logs to Grafana Loki

Installation

pip install aioloki

Usage

import asyncio
import logging
import aiohttp
import aioloki

async def main():
    session = aiohttp.ClientSession()
    handler = aioloki.AioLokiHandler(
        'http://localhost:3100',
        tags={'cluser': '1'},
        session=session
    )
    log = logging.getLogger('test-logging')
    log.addHandler(handler)
    log.info(
        'Setup aioloki successfully',
        extra={'tags': {'function': 'main'}}
    )
    await session.close()

asyncio.run(main())

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

aioloki-0.0.1a1.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aioloki-0.0.1a1-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file aioloki-0.0.1a1.tar.gz.

File metadata

  • Download URL: aioloki-0.0.1a1.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.10

File hashes

Hashes for aioloki-0.0.1a1.tar.gz
Algorithm Hash digest
SHA256 ce787a2b029be56d2b581caf0c6bd37f01b2110843bce475b49166c894be8747
MD5 93f1379373d00d34f694a0f48738f7a4
BLAKE2b-256 8c94f6d4df17e7a7d53849cfdb048ef470b00d40e57423e354a27f733467792a

See more details on using hashes here.

File details

Details for the file aioloki-0.0.1a1-py3-none-any.whl.

File metadata

  • Download URL: aioloki-0.0.1a1-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.10

File hashes

Hashes for aioloki-0.0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 913e620c435505c922ae89e588e47e19bf0f5b4ea506b4dd70806a71831d38b4
MD5 36568b6bd49cadbbe0f5b7a6455ee239
BLAKE2b-256 8463e440021880ed6b8089146393271b32520e2c2c36ccac5ba74a855bf70c4c

See more details on using hashes here.

Supported by

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