From ed708413bf464612481bd42e8b10d7020eda8611 Mon Sep 17 00:00:00 2001 From: indrajeet0510 Date: Wed, 21 Apr 2021 13:09:13 +0530 Subject: [PATCH 1/3] Reporting info and debug logs other than Errors Adding custom resourceType and severity --- stackdriver-errors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackdriver-errors.js b/stackdriver-errors.js index 6e9f868..7ae5e5f 100644 --- a/stackdriver-errors.js +++ b/stackdriver-errors.js @@ -52,7 +52,7 @@ StackdriverErrorReporter.prototype.start = function(config) { this.projectId = config.projectId; this.targetUrl = config.targetUrl; this.context = config.context || {}; - this.serviceContext = {service: config.service || 'web'}; + this.serviceContext = {service: config.service || 'web', resourceType: config.resourceType || "reported_errors", severity: "ERROR" || config.severity}; if (config.version) { this.serviceContext.version = config.version; } From 5c4acd2162340115c9556d4042bea88168113418 Mon Sep 17 00:00:00 2001 From: indrajeet0510 Date: Wed, 21 Apr 2021 13:15:50 +0530 Subject: [PATCH 2/3] Fixing issues with PR --- stackdriver-errors.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stackdriver-errors.js b/stackdriver-errors.js index 7ae5e5f..f9e1144 100644 --- a/stackdriver-errors.js +++ b/stackdriver-errors.js @@ -52,7 +52,10 @@ StackdriverErrorReporter.prototype.start = function(config) { this.projectId = config.projectId; this.targetUrl = config.targetUrl; this.context = config.context || {}; - this.serviceContext = {service: config.service || 'web', resourceType: config.resourceType || "reported_errors", severity: "ERROR" || config.severity}; + this.serviceContext = {service: config.service || 'web', + resourceType: config.resourceType || 'reported_errors, + severity: 'ERROR' || config.severity + }; if (config.version) { this.serviceContext.version = config.version; } From 1204969e53450cf8a9c8a99eda500574ec68ea4a Mon Sep 17 00:00:00 2001 From: indrajeet0510 Date: Wed, 21 Apr 2021 13:19:15 +0530 Subject: [PATCH 3/3] Update stackdriver-errors.js --- stackdriver-errors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackdriver-errors.js b/stackdriver-errors.js index f9e1144..b175801 100644 --- a/stackdriver-errors.js +++ b/stackdriver-errors.js @@ -53,7 +53,7 @@ StackdriverErrorReporter.prototype.start = function(config) { this.targetUrl = config.targetUrl; this.context = config.context || {}; this.serviceContext = {service: config.service || 'web', - resourceType: config.resourceType || 'reported_errors, + resourceType: config.resourceType || 'reported_errors', severity: 'ERROR' || config.severity }; if (config.version) {