Skip to content

Commit

Permalink
Merge pull request #7 from quintoandar/capture-unhandled-rejections
Browse files Browse the repository at this point in the history
[FBI-148] - Make sentry log unhandled promise rejections
  • Loading branch information
AlexandreResende authored Dec 10, 2018
2 parents 05d329b + c10e296 commit 6b6474a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Winston logger with sentry configuration included. Also show the file from which
| SENTRY_ENVIRONMENT | The environment running (dev, staging, prod) |
| SENTRY_RELEASE | The current release |
| CONSOLE_LOG_LEVEL | The level of the logs displayed on the console (optional, defaults to info) |
| CAPTURE_UNHANDLED_REJECTIONS | A value (true or false) saying if you want these exceptions to be logged in you app |

## Usage

Expand Down
3 changes: 3 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ function getLogger(mod) {
app: process.env.SENTRY_APP,
environment: process.env.SENTRY_ENVIRONMENT,
},
config: {
captureUnhandledRejections: CAPTURE_UNHANDLED_REJECTIONS || false,
},
release: process.env.SENTRY_RELEASE,
install: true,
}));
Expand Down

0 comments on commit 6b6474a

Please sign in to comment.