标签: express-winston

Nestjs Winston 日志文件是用颜色编码编写的

我面临与https://github.com/winstonjs/winston/issues/1416相同的问题,结果logger.info(\'Hello there. How are you?\');\xef\xbf\xbd[32minfo\xef\xbf\xbd[39m: \xef\xbf\xbd[32mHello there. How are you?\xef\xbf\xbd[39m

\n

我不知道在哪里colorize可以删除它,这是我的代码:

\n
  new winston.transports.File({\n    format: winston.format.combine(\n      winston.format.colorize({ // I added this but it\'s still not helping\n        all: false,\n        message: false,\n        level: false,\n      }),\n      winston.format.label({ label: \'API\' }),\n      winston.format.timestamp(),\n      winston.format.printf(({ level, message, label, timestamp }) => {\n        return `${timestamp} [${label}] ${level}: ${message}`;\n      }),\n    ),\n    filename: environment.logDirectory,\n    level: \'http\',\n    maxsize: 1024 * 1024 * 10,\n  }),\n
Run Code Online (Sandbox Code Playgroud)\n

在 中main.ts,我有

\n
import { WINSTON_MODULE_NEST_PROVIDER …
Run Code Online (Sandbox Code Playgroud)

winston nestjs express-winston

1
推荐指数
1
解决办法
2552
查看次数

标签 统计

express-winston ×1

nestjs ×1

winston ×1