Winston@3 verror full stack trace, with all nested errors recursively reported as caused by:
+ err.stack
.
npm install winston-verror-format
import { createLogger, format, transports } from "winston";
import { verrorFormat } from "winston-verror-format";
import VError from "verror";
const logger = createLogger({
format: format.combine(verrorFormat({ stack: true }), format.json()),
transports: [new transports.Console()],
});
logger.error(new VError(new Error("Error #1"), "Unexpected error"));
const { createLogger, format, transports } = require("winston");
const { verrorFormat } = require("winston-verror-format");
const VError = require("verror");
const logger = createLogger({
format: format.combine(verrorFormat({ stack: true }), format.json()),
transports: [new transports.Console()],
});
logger.error(new VError(new Error("Error #1"), "Unexpected error"));
Configuration object.
Type: VErrorFormatOptions
Save full stack trace as meta stack
.
Type: boolean
Default: false