Skip to content

Overview

@saflib/vendors-loki adds a Grafana Loki Winston transport for shipping operational logs from @saflib/node services.

What this package provides

  • addLokiTransport() — registers a winston-loki transport on the process log logger with JSON formatting and service_name labels

Integration

Call addLokiTransport() during service bootstrap after setServiceName and alongside other addTransport calls. If hostname/port are unset, logs a warning and skips Loki (local dev continues with the dev log buffer only).

Environment (see env.schema.json):

  • LOKI_HOSTNAME — Loki host (e.g. loki)
  • LOKI_PORT — Loki port (e.g. 3100)

Development log viewing uses @saflib/node-log; Loki is for production log aggregation.