driftwood-sentry-logger
A driftwood logger that reports logs to sentry.io.
Installation
Logger
Augment your root drifwood logger with the sentry logger, giving it a DSN and some options:
const createLogger = require('driftwood')
const createSentryLogger = require('driftwood-sentry-logger')
const additionalLoggers = [createSentryLogger({
dsn: 'https://4092230b68absereg23tggdgd:b2430c23331a4452ac0dsgsdg323@sentry.io/12356'
})]
module.exports = createLogger('my-app', additionalLoggers)
API
createSentryLogger({options})
Creates the logger. options
should can contain the following keys:
dsn
(required): a valid sentry DSNlevel: warn
: which log level and above should be reported to sentrypatchGlobal: false
: whether the sentry client should patch globalslevelMap: {}
: a mapping of driftwood log levels to sentry log levelstags: {}
: additional tags to pass with each log messageextra: {}
: any data to pass to sentry's extra
field