created logger.ts

moved the added stream part directly into the config of morgan in app.ts.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
Philip Molares 2020-04-11 20:08:57 +02:00 committed by David Mehren
parent bb8297dca3
commit 637833ab18
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB
2 changed files with 7 additions and 9 deletions

View file

@ -1,27 +0,0 @@
'use strict'
const { createLogger, format, transports } = require('winston')
const logger = createLogger({
level: 'debug',
format: format.combine(
format.uncolorize(),
format.timestamp(),
format.align(),
format.splat(),
format.printf(info => `${info.timestamp} ${info.level}: ${info.message}`)
),
transports: [
new transports.Console({
handleExceptions: true
})
],
exitOnError: false
})
logger.stream = {
write: function (message, encoding) {
logger.info(message)
}
}
module.exports = logger