mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
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:
parent
bb8297dca3
commit
637833ab18
2 changed files with 7 additions and 9 deletions
21
lib/logger.ts
Normal file
21
lib/logger.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
'use strict'
|
||||
import { createLogger, format, transports } from '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
|
||||
})
|
||||
|
||||
export { logger }
|
Loading…
Add table
Add a link
Reference in a new issue