From ac8002dad384d6f6e2c0cb9c8f7da4bce2220767 Mon Sep 17 00:00:00 2001 From: Harish Deivanayagam <35465026+HarishDeivanayagam@users.noreply.github.com> Date: Thu, 16 Jan 2025 12:55:16 +0530 Subject: [PATCH] fix: undefined type logtail --- mockenv | 1 + src/lib/logger.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mockenv b/mockenv index 55c9ba7..35ff302 100644 --- a/mockenv +++ b/mockenv @@ -12,3 +12,4 @@ REDIS_PASSWORD=[add your redis password] REDIS_DB=[add your redis db in number ex "0"] OPENAI_API_KEY=[add your openai api key] LOGTAIL_TOKEN=[add your logtail token / or it defaults to console logging] +LOGTAIL_SOURCE_TOKEN=your_logtail_token_here diff --git a/src/lib/logger.ts b/src/lib/logger.ts index 0c93cef..7869b20 100644 --- a/src/lib/logger.ts +++ b/src/lib/logger.ts @@ -9,7 +9,7 @@ export class Logger { constructor() { - const transports = process.env.LOGTAIL_TOKEN !== "" ? + const transports = process.env.LOGTAIL_TOKEN && process.env.LOGTAIL_TOKEN !== "" ? new LogtailTransport(new Logtail(process.env.LOGTAIL_TOKEN || "")) : new winston.transports.Console({ format: winston.format.combine(