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
Release history Release notifications | RSS feed
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.1a0.tar.gz
(15.4 kB
view hashes)
Built Distribution
aioloki-0.0.1a0-py3-none-any.whl
(16.3 kB
view hashes)
Close
Hashes for aioloki-0.0.1a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cdfe3443dddea83d72d8961a7c5c399cb4186db4af8f55cdec4327c04817700 |
|
MD5 | 8d346d97e70d011d8a8dc48b2a552dcc |
|
BLAKE2b-256 | 82544456537c3cc1b818b57ae20a82ae0879ab059f545ba5181649ff833af2e6 |