diff --git a/bin/browserid b/bin/browserid index d69fe6767558d96e9b15a8cbfa9360c435873269..32cca02f7f9656f22e46ae55c3ad5d3cb9913121 100755 --- a/bin/browserid +++ b/bin/browserid @@ -213,7 +213,7 @@ function router(app) { // request to logger, dev formatted which omits personal data in the requests app.use(express.logger({ - format: 'dev', + format: config.get('express_log_format'), stream: { write: function(x) { logger.info(typeof x === 'string' ? x.trim() : x); diff --git a/bin/keysigner b/bin/keysigner index ac5fa7f249bec8a734f218e5c2597338e239e538..211cf1c19b1bc563e6f207cbd8d9acc675ca448a 100755 --- a/bin/keysigner +++ b/bin/keysigner @@ -57,7 +57,7 @@ var app = express.createServer(); // our server will log app.use(express.logger({ - format: 'dev', + format: config.get('express_log_format'), stream: { write: function(x) { logger.info(typeof x === 'string' ? x.trim() : x); diff --git a/bin/verifier b/bin/verifier index 8da38a12f39c7d57a035635a3e1271360376af46..de9740281dbafe04f826282e17e7411e1d1c2bcb 100755 --- a/bin/verifier +++ b/bin/verifier @@ -54,6 +54,7 @@ var app = express.createServer(); // request to logger, dev formatted which omits personal data in the requests app.use(express.logger({ + format: config.get('express_log_format'), stream: { write: function(x) { logger.info(typeof x === 'string' ? x.trim() : x); diff --git a/lib/configuration.js b/lib/configuration.js index a71fc10d6312e51971130f5955f23badc99591a4..da7982c4415a1a4518d97c51965927241305cc92 100644 --- a/lib/configuration.js +++ b/lib/configuration.js @@ -202,6 +202,8 @@ exports.performSubstitution = function(app) { } }; +g_config['express_log_format'] = (exports.get('env') === 'production' ? 'default' : 'dev'); + // At the time this file is required, we'll determine the "process name" for this proc // if we can determine what type of process it is (browserid or verifier) based // on the path, we'll use that, otherwise we'll name it 'ephemeral'. diff --git a/lib/logging.js b/lib/logging.js index 3e7feb5a1a7d7e972f572b5c4923aaf205c4471f..6382a9030096f2e1515d48e4122f7fef0e8ed132 100644 --- a/lib/logging.js +++ b/lib/logging.js @@ -38,7 +38,7 @@ * A very thin wrapper around winston for general server logging. * Exports a winston Logger instance in exports.logger with several functions * corresponding to different log levels. use it like this: - * + * * const logger = require('../libs/logging.js').logger; * logger.debug("you can probably ignore this. just for debugging."); * logger.info("something happened, here's info about it!");