Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danwakeem/loopback-rollbar-logger
Rollbar logger for loopback applications
https://github.com/danwakeem/loopback-rollbar-logger
Last synced: about 6 hours 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 (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T17:44:13.000Z (almost 2 years ago)
- Last Synced: 2024-10-03T07:05:43.139Z (about 1 month ago)
- Language: JavaScript
- Size: 470 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Loopback Rollbar Logger
[![Build Status](https://travis-ci.com/Danwakeem/loopback-rollbar-logger.svg?branch=master)](https://travis-ci.com/Danwakeem/loopback-rollbar-logger)
[![Coverage Status](https://coveralls.io/repos/github/Danwakeem/loopback-rollbar-logger/badge.svg?branch=master)](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
}
},
...
}
...
```