Skip to content

Node.js based forum software built for the modern web

updated winston config to only use json logging if --json-logging flag is passed in or set in config

Julian Lam560dc15819f0
diff --git a/app.js b/app.js
index b2397f3080..1998e4c60c 100644
--- a/app.js
+++ b/app.js
@@ -38,11 +38,11 @@ winston.add(winston.transports.Console, {
colorize: true,
timestamp: function () {
var date = new Date();
- return (global.env === 'production') ? date.toJSON() : date.getDate() + '/' + (date.getMonth() + 1) + ' ' + date.toTimeString().substr(0,5) + ' [' + global.process.pid + ']';
+ return (!!nconf.get('json-logging')) ? date.toJSON() : date.getDate() + '/' + (date.getMonth() + 1) + ' ' + date.toTimeString().substr(0,5) + ' [' + global.process.pid + ']';
},
level: nconf.get('log-level') || (global.env === 'production' ? 'info' : 'verbose'),
- json: (global.env === 'production'),
- stringify: (global.env === 'production')
+ json: (!!nconf.get('json-logging')),
+ stringify: (!!nconf.get('json-logging'))
});