Skip to content

Commit

Permalink
Merge pull request #10 from talis/ELE-2170-new-relic-client-errors
Browse files Browse the repository at this point in the history
ELE-2170 New Relic support
  • Loading branch information
pogotc authored Dec 2, 2019
2 parents 0491912 + 8096846 commit 4d8390b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 2.1.6 (2019-12-2)

Improvement:

- Added support for NewRelic logging so errors can be sent there if needed

## 2.1.4 (2016-11-01)

Improvement:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The config object to be passed to each service has the following properties:
- LOGGING_TYPE (can be local|remote|none)
- local: log to local console only
- remote: log to local console and remote endpoint
- newrelic: forward onto the NewRelic error handler if there's one available
- none: perform no logging
- REMOTE_LOGGING_ENDPOINT: the full URL to the endpoint where log messages are sent via AJAX POST
- REMOTE_ERROR_REPORT_ENDPOINT: the full URL to the endpoint where user error reports will be sent via AJAX POST
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app-logger-angular",
"version": "2.1.5",
"version": "2.1.6",
"main": "./js/logging.js",
"description": "Client side logging sent to the server",
"repository": {
Expand Down
4 changes: 4 additions & 0 deletions js/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ loggingModule.factory(
$log.error.apply($log, arguments);
}

if (LOGGING_CONFIG.LOGGING_TYPE === 'newrelic' && $window.NREUM && $window.NREUM.noticeError) {
$window.NREUM.noticeError(exception);
}

// check if the config says we should log to the remote, and also if a remote endpoint was specified
if (LOGGING_CONFIG.LOGGING_TYPE === 'remote' && LOGGING_CONFIG.REMOTE_LOGGING_ENDPOINT) {
// now log server side.
Expand Down

0 comments on commit 4d8390b

Please sign in to comment.