https://github.com/danwakeem/loopback-rollbar-logger
Rollbar logger for loopback applications
https://github.com/danwakeem/loopback-rollbar-logger
Last synced: 25 days ago
JSON representation
Rollbar logger for loopback applications
- Host: GitHub
- URL: https://github.com/danwakeem/loopback-rollbar-logger
- Owner: Danwakeem
- Created: 2019-05-28T20:19:26.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T17:44:13.000Z (over 2 years ago)
- Last Synced: 2025-06-03T03:33:50.805Z (about 1 month ago)
- Language: JavaScript
- Size: 470 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Loopback Rollbar Logger
[](https://travis-ci.com/Danwakeem/loopback-rollbar-logger)
[](https://coveralls.io/github/Danwakeem/loopback-rollbar-logger?branch=master)This is a simple loopback middleware component to log errored requests to rollbar
## Useage
### Install package
`npm i loopback-rollbar-logger`
### Set up environment for rollbar
You will need to have the `ROLLBAR_ACCESS_TOKEN` key set in your environment so the package knows what rollbar account to log to.`process.env.ROLLBAR_ACCESS_TOKEN`
### Integrate with loopback
Then in your `middleware.json` file add the following
```json
...
"final:after": {
"loopback-rollbar-logger": {},
...
}
...
```This will log all errored requests to your rollbar account.
## Rollbar info
This package is based on the [Rollbar.js](https://www.npmjs.com/package/rollbar) package. So if you would like to pass any options on initalization to the Rollbar.js package then you can pass those in to the middleware via the `params` key.### Eample
```json
...
"final:after": {
"loopback-rollbar-logger": {
"params": {
// Here you can specify Rollbar.js options that will get passed into the constructor
}
},
...
}
...
```