driftwood-sentry-logger
v1.1.0
Published
A driftwood logger that reports to sentry.io
Downloads
19
Readme
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')
// Create the sentry logger as an additional logger to pass to driftwood
const additionalLoggers = [createSentryLogger({
dsn: 'https://4092230b68absereg23tggdgd:[email protected]/12356'
})]
// Create driftwood, passing in the additional loggers
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'sextra
field