Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.options = options
const loggerOptions: PinoLoggerOptions = {
name: options.name,
level: options.level || 'debug',
// Remove pid and hostname considering production runs inside docker
base: null,
}
let loggerStreams: Streams = [{ stream: process.stdout }]
if (options.sentryOptions) {
loggerStreams.push({
level: 'error',
stream: createWriteStream({
...options.sentryOptions,
stackAttributeKey: 'err',
}),
})
}
if (options.streams) loggerStreams = loggerStreams.concat(options.streams)
this.inner = pino(loggerOptions, pinoms.multistream(loggerStreams))
}