Skip to content

Instantly share code, notes, and snippets.

@kirikintha
Created November 5, 2014 22:38
Show Gist options
  • Save kirikintha/5f3471adfae8f9ab14dc to your computer and use it in GitHub Desktop.
Save kirikintha/5f3471adfae8f9ab14dc to your computer and use it in GitHub Desktop.
Sample Winston Logger Config File (Winston configuration values only)
'use strict';
module.exports = {
//Winston Logging variables.
winston: {
//Transport Type (none|mail|sns|mongo|paperTrail)
transport: 'none',
//Mail Transport via SMTP
mail: {
to: '[email protected]',
from: '[email protected]',
host: '',
port: 25,
username: '',
password: '',
ssl: false,
level: 'info',
silent: false
},
//Simple Notification Server (AWS)
sns: {
aws_key: '',
aws_secret: '',
subscriber: '',
topic_arn: '',
region: 'us-east-1',
subject: 'Winston Notification',
message: 'Level \'%l\':\n%e\n\nMetadata:\n%m',
level: 'info',
json: false,
handleExceptions: false
},
//MongoDb Logging.
mongo: {
level: 'info',
silent: false,
db: '',
collection: 'logs',
name: '',
//safe: true,
//nativeParser: '',
//host: '',
//port: '',
//username: '',
//password: '',
//errorTimeout: 10000,
//timeout: 10000,
//storeHost: true,
//label: '',
//ssl: '',
//authDb: {},
//replSet: '',
//hosts: [{host: 'string', port: 'number'}]
//dbUri: ''
},
//Logging to Paper Trail. (requires paper trail account)
paperTrail: {
level: 'info',
host: '',
port: '',
//hostname: '',
//program: '',
//logFormat: ''
},
//Categories House the individual configurations you can draw from.
// the .log() function takes into account for these categories, so you
// can pass variables to the log function.
//@TODO - probably change this up.
categories: {
//Logging levels.
debug: {
console: {
level: 'debug'
},
file: {
//Default log level is on errors only.
level: 'debug',
filename: './app/logs/debug.log'
}
},
error: {
console: {
level: 'error'
},
file: {
level: 'error',
filename: './app/logs/error.log'
}
}
}
}
//Other Configuration Options for your App...
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment