Compare View
Commits (2)
Changes
Showing 3 changed files Side-by-side Diff
logger.js
1 | 1 | "use strict"; |
2 | 2 | |
3 | -const PID = process.pid; | |
4 | - | |
5 | 3 | const winston = require('winston'); |
6 | 4 | |
7 | 5 | require('winston-daily-rotate-file'); |
... | ... | @@ -28,8 +26,8 @@ const logger = winston.createLogger({ |
28 | 26 | format: winston.format.combine( |
29 | 27 | winston.format.metadata(), |
30 | 28 | winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss.SSS' }), |
31 | - winston.format.label({ label: `${global.KOMODO_LOG_LABEL || process.title}[${PID}]`, message: false }), | |
32 | - winston.format.printf((info) => `${process.stdout.isTTY ? info.timestamp : ''} ${info.label}: ${info.level}: ${info.message} ${info.metadata && Object.keys(info.metadata).length ? JSON.stringify(info.metadata) : ''}`.trim()), | |
29 | + winston.format.label({ label: global.KOMODO_LOG_LABEL, message: false }), | |
30 | + winston.format.printf((info) => `${process.stdout.isTTY ? info.timestamp : ''}${info.label ? ' ' + info.label + ':' : ''} ${info.level}: ${info.message} ${info.metadata && Object.keys(info.metadata).length ? JSON.stringify(info.metadata) : ''}`.trim()), | |
33 | 31 | ) |
34 | 32 | }), |
35 | 33 | |
... | ... | @@ -40,11 +38,10 @@ const logger = winston.createLogger({ |
40 | 38 | |
41 | 39 | format: winston.format.combine( |
42 | 40 | winston.format.metadata(), |
43 | - winston.format.label({ label: `${global.KOMODO_LOG_LABEL || process.title}[${PID}]`, message: false }), | |
41 | + winston.format.label({ label: global.KOMODO_LOG_LABEL || 'no-label', message: false }), | |
44 | 42 | winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss.SSS' }), |
45 | 43 | winston.format.json(), |
46 | 44 | ) |
47 | - | |
48 | 45 | }), |
49 | 46 | |
50 | 47 | /* |
package-lock.json