-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlogger.js
More file actions
29 lines (27 loc) · 783 Bytes
/
logger.js
File metadata and controls
29 lines (27 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const winston = require('winston')
const winstonDaily = require('winston-daily-rotate-file')
const moment = require('moment')
const logger = winston.createLogger({
level:'info',
format:winston.format.combine(
winston.format.timestamp({
format:'YYYY-MM-DD HH:mm:ss.SSS ZZ'
}),
winston.format.errors({stack:true}),
winston.format.splat(),
winston.format.json()
),
defaultMeta:{service:'Physics_Helper'},
transports:[
new winston.transports.File({
filename:'./log/error.log',
level:'error',
prettyPrint:true,
}),
new winston.transports.File({
filename:'./log/info.log',
prettyPrint:true
})
]
})
module.exports=logger