mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-30 03:49:12 -05:00
Merge pull request #1059 from SISheogorath/fix/winstonStreaming
Fix streaming for winston
This commit is contained in:
commit
7328e7ad79
2 changed files with 10 additions and 2 deletions
2
app.js
2
app.js
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue