diff --git a/app.js b/app.js index 33956ce99..618fba150 100644 --- a/app.js +++ b/app.js @@ -53,7 +53,7 @@ if (config.useSSL) { // logger app.use(morgan('combined', { - 'stream': logger + 'stream': logger.stream })) // socket io diff --git a/lib/logger.js b/lib/logger.js index c70b81b89..5ef1860a1 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -1,7 +1,7 @@ 'use strict' const {createLogger, format, transports} = require('winston') -module.exports = createLogger({ +const logger = createLogger({ level: 'debug', format: format.combine( format.uncolorize(), @@ -17,3 +17,11 @@ module.exports = createLogger({ ], exitOnError: false }) + +logger.stream = { + write: function (message, encoding) { + logger.info(message) + } +} + +module.exports = logger