Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
seqStreamParams.batchSizeLimit = seqConfig.batchSizeLimit;
if (seqConfig.maxBatchingTime !== undefined)
seqStreamParams.maxBatchingTime = seqConfig.maxBatchingTime;
if (seqConfig.reemitErrorEvents !== undefined)
seqStreamParams.reemitErrorEvents = seqConfig.reemitErrorEvents;
// NB: Define only one bunyan stream! Otherwise, we will get logging messages coming out multiple times, once for each stream. (https://github.com/trentm/node-bunyan/issues/334)
// This one stream must accept messages at all levels. That is why we set it to "trace". That is just its lower limit.
seqStreamParams.level = "trace";
const bunyanLogger = bunyan.createLogger({
name: loggerName,
streams: [
seq.createStream(seqStreamParams),
],
});
return bunyanLogger;
}
build() {
if ($log.level !== "OFF") {
this.logger = createLogger({
name: $log.name,
streams: [
createStream({
serverUrl: this.config.url,
apiKey: this.config.apiKey,
level: $log.level
})
]
});
}
}