When creating a logging transport, you can provide a parameter labelthat will be added to the log output between the log level and the log message. For instance:
var logger = new (winston.Logger)({
transports: [
new (winston.transports.Console)({
colorize: true,
prettyPrint: true,
timestamp: true,
label: 'CustomLabel'
})
]
});
This will lead to the following conclusion:
2016-09-06T12:16:17.335Z - info: [CustomLabel] hello
darsh source
share