mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: logger display error stack
This commit is contained in:
1 parent
a7e646c28b
commit
fb6411e923
2 files changed
+6
-3
No files matched your search
@@ -1,9 +1,13 @@
|
||||
import winston from 'winston'
|
||||
import winston, { format } from 'winston'
|
||||
import config from '../config.js'
|
||||
|
||||
const logger = winston.createLogger({
|
||||
level: 'info',
|
||||
format: winston.format.json(),
|
||||
format: format.combine(
|
||||
format.errors({ stack: true }),
|
||||
format.timestamp(),
|
||||
format.json()
|
||||
),
|
||||
defaultMeta: { service: 'backend', timestamp: new Date().toISOString() },
|
||||
transports: [
|
||||
//
|
||||
|
||||
Reference in new issue
Block a user