Winston transport for Logmatic
npm i -S winston-logmatic
You need to pass down a node-logmatic config objects to winston-logmatic for him to work.
{
logmatic: {
token: undefined, // Required : your Logmatic token
defaultProps: {} // add a default value to your log messages (like appname or hostname)
}
}
new Winston.Logger({
transports: [
new Winston.transports.Console({
colorize: true,
timestamp: true
}),
new WinstonLogmatic({
logmatic: {
token: 'MY_TOKEN',
defaultProps: {
appname: require('./package.json').name,
hostname: 'prod'
}
}
})
],
timestamp: true,
level: 'debug'
});