Skip to content

Commit cdcb159

Browse files
authored
Merge pull request #12 from talis/ELE-3188-new-relic-error-fix
ELE-3188 only errors should go into NewRelic
2 parents 25f12f0 + f7d2282 commit cdcb159

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "app-logger-angular",
3-
"version": "2.1.7",
3+
"version": "2.1.8",
44
"main": "./js/logging.js",
55
"description": "Client side logging sent to the server",
66
"repository": {

js/logging.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ loggingModule.factory(
118118
return (iRequestedLevel >= iLoggingThreshold);
119119
};
120120

121-
var log = function (severity, message, desc) {
121+
var log = function (severity, message, desc, sendToNewRelic) {
122122
if (!isLoggingEnabledForSeverity(severity)) {
123123
return;
124124
}
@@ -139,7 +139,7 @@ loggingModule.factory(
139139
}
140140
}
141141

142-
if (LOGGING_CONFIG.FORWARD_TO_NEWRELIC && $window.NREUM && $window.NREUM.noticeError) {
142+
if (sendToNewRelic && $window.NREUM && $window.NREUM.noticeError) {
143143
$window.NREUM.noticeError(message, {desc: desc});
144144
}
145145

@@ -181,7 +181,8 @@ loggingModule.factory(
181181
log('warn', message, desc);
182182
},
183183
error: function (message, desc) {
184-
log('error', message, desc);
184+
var sendToNewRelic = LOGGING_CONFIG.FORWARD_TO_NEWRELIC && $window.NREUM && $window.NREUM.noticeError;
185+
log('error', message, desc, sendToNewRelic);
185186
},
186187
setLoggingThreshold: function (level) {
187188
/*

0 commit comments

Comments
 (0)