Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

[proposal] Update sails.config.log.md #1297

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions reference/sails.config/sails.config.log.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down