Utilitiesv0.1.4
@tekir/logger-loki
Grafana Loki transport for @tekir/logger.
Installation
$
bun add @tekir/logger-lokiFeatures
- Pushes logs to Grafana Loki endpoint
- Configurable labels for log streams
- Basic auth and custom headers
- Batched delivery for performance
- Works with any Loki-compatible backend
Quick Example
TypeScript
import { createLogger } from '@tekir/logger'
import { LokiTransport } from '@tekir/logger-loki'
const logger = createLogger({
transports: [new LokiTransport({
host: 'http://localhost:3100',
labels: { app: 'my-api' },
})],
})Changelog
v0.1.4LatestSeptember 16, 2026
- Published output now uses the shared Node-targeted ESM bundle pipeline with external dependencies and generated TypeScript declarations, while Bun consumers keep the native source export.
v0.1.3July 23, 2026
- Package metadata now follows the shared compatible
0.1.xdependency range used by this coordinated Tekir release.
v0.1.2July 16, 2026
- Loki Basic authentication now supports Unicode credentials without failing during header encoding.
v0.1.1June 13, 2026
- The Loki host is now validated to close an SSRF surface. Only
http/httpsis allowed, and loopback, private, link-local, and cloud-metadata hosts are rejected by default. SetallowInsecureHost: trueto opt into local/dev targets. Behavior change:localhostnow requiresallowInsecureHost. - When
authis configured, anhttp://target is rejected withoutallowInsecureHostso credentials are not sent in plaintext. - Added a
maxBufferSize(default 10000, drop-oldest with a counter) andres.okchecking, so a stalled endpoint cannot grow the buffer without bound and failed deliveries surface via an error counter and optionalonError(err). The flush timer is unref'd. - Found and fixed with Fable.
v0.1.0April 1, 2026
- Initial release