summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--app.js2
-rw-r--r--lib/logger.js10
2 files changed, 10 insertions, 2 deletions
diff --git a/app.js b/app.js
index 33956ce9..618fba15 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 c70b81b8..5ef1860a 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