book-raven
raven middleware for the book logging framework
use
var log = ; // add the middleware to your loggerlog; log;log;
handle errors from sentry
Sometimes the messages cannot be sent to sentry. In this case the on_error
function will be called with the error. If no on_error
function is specified, the error will simply be thrown and any uncaughtException
handlers you have installed will catch it (or your app will crash).
It is recommended to install some sort of on_error
handler.
log
configure levels to send
By default, only PANIC, ERROR, and WARN levels are sent to sentry. If you wish to
By default, all log entries are sent. If you wish to limit logging to specific levels use the ignore_levels
option.
Below is an example of ignoring all levels above (less critical) than WARN. So PANIC, ERROR, and WARN will be sent to sentry, but INFO, DEBUG, and TRACE will not.
log
uncaughtException
If you use process uncaughtException to handle the error and wish to exit. Make sure to exit after a short timeout. This will give the raven logger a chance to send the http request.
process
install
npm install booknpm install book-raven