mirror of
https://github.com/kaythomas0/noisedash.git
synced 2025-11-11 19:06:20 +00:00
25 lines
675 B
JavaScript
25 lines
675 B
JavaScript
const winston = require('winston')
|
|
const config = require('config')
|
|
|
|
const logger = winston.createLogger({
|
|
level: 'info',
|
|
format: winston.format.combine(
|
|
winston.format.timestamp({
|
|
format: 'YYYY-MM-DD HH:mm:ss'
|
|
}),
|
|
winston.format.errors({ stack: true }),
|
|
winston.format.splat(),
|
|
winston.format.json()
|
|
),
|
|
defaultMeta: { service: 'noisedash' },
|
|
transports: [
|
|
//
|
|
// - Write to all logs with level `info` and below to `quick-start-combined.log`.
|
|
// - Write all logs error (and below) to `quick-start-error.log`.
|
|
//
|
|
new winston.transports.File({ filename: config.get('Server.logFilePath') })
|
|
]
|
|
})
|
|
|
|
module.exports = logger
|