UNPKG

logs-interceptor

Version:

High-performance, production-ready log interceptor for Node.js applications with Loki integration. Built with Clean Architecture principles. Supports Node.js, Browser, and Node-RED.

34 lines 1.21 kB
/** * Infrastructure: Loki Transport Implementation */ import { ILogTransport, TransportHealth } from '../../domain/interfaces/ILogTransport'; import { LogEntry } from '../../domain/entities/LogEntry'; import { ICircuitBreaker } from '../../domain/interfaces/ICircuitBreaker'; export interface LokiTransportConfig { readonly url: string; readonly tenantId: string; readonly authToken?: string; readonly timeout?: number; readonly maxRetries?: number; readonly retryDelay?: number; readonly compression?: boolean; readonly compressionLevel?: number; } export declare class LokiTransport implements ILogTransport { private readonly config; private readonly circuitBreaker?; private httpClient; private health; private consecutiveFailures; constructor(config: LokiTransportConfig, circuitBreaker?: ICircuitBreaker | undefined); private setupHttpClient; send(entries: LogEntry[]): Promise<void>; private retryOperation; private formatForLoki; isAvailable(): Promise<boolean>; getHealth(): TransportHealth; private recordSuccess; private recordFailure; destroy(): Promise<void>; } //# sourceMappingURL=LokiTransport.d.ts.map