From 4aef7a8c4437c3e3502dd8150ccb14484fdefd8e Mon Sep 17 00:00:00 2001 From: ImLunaHey <105922175+ImLunaHey@users.noreply.github.com> Date: Thu, 4 May 2023 23:31:32 +0930 Subject: [PATCH] fix: https://github.com/winstonjs/winston/issues/2133#issuecomment-1205994715 --- src/logger.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/logger.ts b/src/logger.ts index 5e3f981..7409b45 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -1,18 +1,15 @@ -import winston from 'winston'; +import winston, { format } from 'winston'; import { WinstonTransport as AxiomTransport } from '@axiomhq/axiom-node'; import chalk from 'chalk'; import * as pkg from '@app/../package.json'; -import { serializeError } from 'serialize-error'; import { getCommitHash } from '@app/common/get-commit-hash'; export const globalLogger = winston.createLogger({ level: 'info', - format: winston.format.json({ - replacer(key: string, value: unknown) { - if (key === 'error') return JSON.stringify(serializeError(value)); - return value; - }, - }), + format: format.combine( + format.errors({ stack: true }), + format.json() + ), defaultMeta: { botName: pkg.name, pid: process.pid,