
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
bunyan-opbeat
Advanced tools
Bunyan stream for Opbeat
# install bunyan
$ npm i --save bunyan
# install bunyan-opbeat
$ npm i --save bunyan-opbeat
var bunyan = require('bunyan')
var BunyanOpbeat = require('bunyan-opbeat')
var log = bunyan.createLogger({
name: 'my-logger',
streams: [
{
level: 'warn',
type: 'raw', // <-- this is mandatory so bunyan-opbeat gets the log as an object
stream: new BunyanOpbeat({
config: {
appId: '...',
organizationId: '...',
secretToken: '...',
// you can also add any other parameter that opbeat module accepts, it will be passed on
}
})
}
]
})
log.error(new Error('whoops'))
Alternatively, if you've already started an opbeat instance somewhere else in your code, you can pass it directly to bunyan-opbeat and it will use it instead:
var bunyan = require('bunyan')
var BunyanOpbeat = require('bunyan-opbeat')
var opbeat = require('opbeat').start({
appId: '...',
organizationId: '...',
secretToken: '...'
})
var log = bunyan.createLogger({
name: 'my-logger',
streams: [
{
level: 'warn',
type: 'raw', // <-- this is mandatory so bunyan-opbeat gets the log as an object
stream: new BunyanOpbeat({
client: opbeat
})
}
]
})
log.error(new Error('whoops'))
bunyan-opbeat
requires opbeat
client version >= 4.8.0bunyan-opbeat reads data coming from your bunyan logger and uses opbeat.captureError()
to post it to Opbeat.
It will do it's best to pass on some common fields like user
, time
, hostname
and level
.
Anything else in your logs that opbeat can't understand will be passed as an extra
field
FAQs
Bunyan stream for Opbeat
We found that bunyan-opbeat demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.