-
Notifications
You must be signed in to change notification settings - Fork 7
/
svr-winston.js
37 lines (35 loc) · 1.23 KB
/
svr-winston.js
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
30
31
32
33
34
35
36
37
// Distributed under AGPLv3 license: see /LICENSE for terms. Copyright 2019-2023 Dominic Morris.
const { createLogger, format, transports } = require('winston')
// const logger = createLogger({
// level: 'info',
// format: format.combine(
// format.timestamp({
// format: 'YYYY-MM-DD HH:mm:ss'
// }),
// format.errors({ stack: true }),
// format.splat(),
// format.json()
// ),
// defaultMeta: { service: 'scpx-w' },
// transports: [
// //
// // - Write to all logs with level `info` and below to `combined.log`
// // - Write all logs error (and below) to `error.log`.
// //
// new transports.File({ filename: './error.log', level: 'error' }),
// new transports.File({ filename: './info.log' }),
// new transports.File({ filename: './debug.log' })
// ]
// })
//
// If we're not in production then **ALSO** log to the `console`
// with the colorized simple format.
//
// if (process.env.NODE_ENV !== 'production') {
// logger.add(new transports.Console({
// format: format.combine(
// format.colorize(),
// format.simple()
// )
// }))
// }