Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (process.env.GTM_LOGSTASH_HOST) {
let logstashPort = process.env.GTM_LOGSTASH_PORT || 5000;
bunyanConf.streams.push({
type: 'raw',
stream: bunyanTcp
.createStream({
host: process.env.GTM_LOGSTASH_HOST,
port: logstashPort
})
.on('error', console.error)
});
}
return bunyan.createLogger(bunyanConf);
}