aioloki 0.0.1a1

Creator: bradpython12

Last updated:

0 purchases

aioloki 0.0.1a1 Image
aioloki 0.0.1a1 Images

Languages

Categories

Add to Cart

Description:

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())

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.