minor on logs
This commit is contained in:
@@ -21,10 +21,11 @@ async function main () {
|
|||||||
} else {
|
} else {
|
||||||
await nuxt.ready()
|
await nuxt.ready()
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await nuxt.listen()
|
await nuxt.listen()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log.error(e)
|
log.error({ message: e.message })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ const DailyRotateFile = require('winston-daily-rotate-file')
|
|||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
const config = require('config')
|
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}`
|
return `${dayjs(timestamp).format('DD MMM YYYY HH:mm:ss')} ${level}: ${message}`
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ const logger = createLogger({
|
|||||||
handleExceptions: true,
|
handleExceptions: true,
|
||||||
handleRejections: true,
|
handleRejections: true,
|
||||||
level: 'debug',
|
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({
|
: [new DailyRotateFile({
|
||||||
|
|||||||
Reference in New Issue
Block a user