python-logging-loki
Loki的Python日志记录处理程序。
安装
pip install python-logging-loki
用法
import logging
import logging_loki
handler = logging_loki . LokiHandler (
url = "https://my-loki-instance/loki/api/v1/push" ,
tags = { "application" : "my-app" },
auth = ( "username" , "password" ),
version = "1" ,
)
logger = logging . getLogger ( "my-logger" )
logger . addHandler ( handler )
logger
2021-06-17 14:50:31
13KB
Python
1