logform-json-error-replacer
v1.0.0
Published
A simple helper function to help serialize errors in winston.
Downloads
6
Readme
logform-json-error-replacer
A simple helper function to help serialize errors in winston.
Example
const logformJsonErrorReplacer = require('logform-json-error-replacer');
const { createLogger, format, transports } = require('winston');
const { combine, timestamp, json } = format;
const logger = createLogger({
format: combine(
timestamp(),
json({ replacer: logformJsonErrorReplacer })
),
transports: [new transports.Console()]
});