A scalable instance associated module for logging in Grafana Loki
pip install pyloki
from pyloki import PyLoki
auth_loki = PyLoki(source='Authentication Service', job='auth.service')
auth_loki.warn('This module is warning me of something')
host
: Host of your Loki instancedefault: localhost
port
: Port if neededdefault: 3100
- If secured:
username
password
protocol
: Protocol to followdefault: http
src_host
: Host from which the logs are being streamed
set_tz(zone='Asia/Kolkata')
Sets your timezone for the log stream
set_header(key, value)
Sets additional http headers to logs
MIT