using config file for logger level

This commit is contained in:
KDSBrowne 2016-12-01 08:15:57 -08:00
parent 9187a020d6
commit 24643f01dd
2 changed files with 4 additions and 3 deletions

View File

@ -22,13 +22,13 @@ Logger.add(Winston.transports.Console, {
handleExceptions: true, handleExceptions: true,
}); });
// Set Logger message level priority for the console
Logger.transports.console.level = 'info';
Meteor.startup(() => { Meteor.startup(() => {
const LOG_CONFIG = Meteor.settings.log || {}; const LOG_CONFIG = Meteor.settings.log || {};
let filename = LOG_CONFIG.filename; let filename = LOG_CONFIG.filename;
// Set Logger message level priority for the console
Logger.transports.console.level = LOG_CONFIG.level;
// Determine file to write logs to // Determine file to write logs to
if (filename) { if (filename) {
if (Meteor.settings.runtime.env === 'development') { if (Meteor.settings.runtime.env === 'development') {

View File

@ -1,2 +1,3 @@
log: log:
filename: '/log/development.log' filename: '/log/development.log'
level: 'info'