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 // logger
app.use(morgan('combined', { app.use(morgan('combined', {
'stream': logger 'stream': logger.stream
})) }))
// socket io // socket io

View file

@ -1,7 +1,7 @@
'use strict' 'use strict'
const {createLogger, format, transports} = require('winston') const {createLogger, format, transports} = require('winston')
module.exports = createLogger({ const logger = createLogger({
level: 'debug', level: 'debug',
format: format.combine( format: format.combine(
format.uncolorize(), format.uncolorize(),
@ -17,3 +17,11 @@ module.exports = createLogger({
], ],
exitOnError: false exitOnError: false
}) })
logger.stream = {
write: function (message, encoding) {
logger.info(message)
}
}
module.exports = logger