Merge pull request #1059 from SISheogorath/fix/winstonStreaming

Fix streaming for winston
This commit is contained in:
Christoph (Sheogorath) Kern 2018-11-17 11:36:56 +01:00 committed by GitHub
commit 7328e7ad79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

2
app.js
View File

@ -53,7 +53,7 @@ if (config.useSSL) {
// logger
app.use(morgan('combined', {
'stream': logger
'stream': logger.stream
}))
// socket io

View File

@ -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