grafana-logger
Version:
A functional logging package for Grafana with structured JSON output
24 lines • 926 B
TypeScript
import { FastifyInstance, FastifyPluginOptions } from "fastify";
export interface GrafanaLoggerOptions extends FastifyPluginOptions {
serviceName: string;
logLevel?: string;
component?: string;
traceId?: string;
processId?: string;
tags?: string[];
requestPayload?: Record<string, any>;
}
/**
* Fastify plugin that integrates Grafana Logger as the logging system
*
* This plugin replaces the default Pino logger with our Grafana Logger
* while maintaining compatibility with Fastify's logging interface.
*
* @param fastify - Fastify instance
* @param options - Plugin options including service name and logger configuration
*/
declare function grafanaLoggerPlugin(fastify: FastifyInstance, options: GrafanaLoggerOptions): Promise<void>;
declare const _default: typeof grafanaLoggerPlugin;
export default _default;
export { grafanaLoggerPlugin };
//# sourceMappingURL=fastify-plugin.d.ts.map