minor on logs

This commit is contained in:
les
2021-06-21 00:44:43 +02:00
parent 6dc9f7d261
commit fc2ea9c89d
2 changed files with 4 additions and 3 deletions

View File

@@ -21,10 +21,11 @@ async function main () {
} else {
await nuxt.ready()
}
try {
await nuxt.listen()
} catch (e) {
log.error(e)
log.error({ message: e.message })
return
}

View File

@@ -3,7 +3,7 @@ const DailyRotateFile = require('winston-daily-rotate-file')
const dayjs = require('dayjs')
const config = require('config')
const gancioFormat = format.printf(({ timestamp, level, message }) => {
const gancioFormat = format.printf(({ timestamp, level, message, error }) => {
return `${dayjs(timestamp).format('DD MMM YYYY HH:mm:ss')} ${level}: ${message}`
})
@@ -15,7 +15,7 @@ const logger = createLogger({
handleExceptions: true,
handleRejections: true,
level: 'debug',
format: format.combine(format.timestamp(), format.splat(), format.colorize(), gancioFormat)
format: format.combine(format.errors({ stack: true }), format.timestamp(), format.colorize(), format.splat(), gancioFormat)
}
)]
: [new DailyRotateFile({