From 2c7e3105b4113d55362d3c799ebccbc1dc7f2721 Mon Sep 17 00:00:00 2001 From: Shashan Sooriyahetti Date: Wed, 22 Jan 2020 15:05:44 +0530 Subject: [PATCH] Update sails.config.log.md "npm i winston" now installs new Winston 3.x.x version. Making changes therefor users do not confuse with non working code --- reference/sails.config/sails.config.log.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/sails.config/sails.config.log.md b/reference/sails.config/sails.config.log.md index ba9deb54c..f7c498c18 100644 --- a/reference/sails.config/sails.config.log.md +++ b/reference/sails.config/sails.config.log.md @@ -24,20 +24,20 @@ Here's an example configuring [Winston](https://github.com/winstonjs/winston) as // config/log.js var winston = require('winston'); -var customLogger = new winston.Logger(); +var customLogger = winston.createLogger(); // A console transport logging debug and above. -customLogger.add(winston.transports.Console, { +customLogger.add(new winston.transports.Console, { level: 'debug', colorize: true }); // A file based transport logging only errors formatted as json. -customLogger.add(winston.transports.File, { +customLogger.add(new winston.transports.File({ level: 'error', filename: 'filename.log', - json: true -}); + format: winston.format.json(), +})); module.exports.log = { // Pass in our custom logger, and pass all log levels through.