0 purchases
aioloki 0.0.1a1
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())
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.