@gus-eip/loggers 3.4.0 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ export declare class CloudWatchLoggerService implements ILogger {
|
|
10
10
|
createLogStream(logStreamName: string): Promise<any>;
|
11
11
|
logToCloudWatch(type: string, logObject: any, logStreamName: string): Promise<void>;
|
12
12
|
logStreamExists(logStreamName: string): Promise<boolean>;
|
13
|
-
sendAlerttoTeams(errorMessage: any, handler: any, input: any): Promise<any>;
|
13
|
+
sendAlerttoTeams(errorMessage: any, handler: any, input: any, logStreamName: any): Promise<any>;
|
14
14
|
log(correlationId: string, timestamp: string, component: string, source: string, destination: string, event: string, usecase: string, sourcePayload: any, destinationPayload: any, logMessage: any, brand: any, secondaryKey: string, logStreamName: string, destinationObjectType?: string, destinationObjectId?: string, sourceObjectType?: string, sourceObjectId?: string, destinationResponse?: any): Promise<any>;
|
15
15
|
error(correlationId: string, timestamp: string, component: string, source: string, destination: string, event: string, usecase: string, sourcePayload: any, destinationPayload: any, errorMessage: any, brand: any, secondaryKey: string, logStreamName: string, destinationObjectType?: string, destinationObjectId?: string, sourceObjectType?: string, sourceObjectId?: string, destinationResponse?: any): Promise<any>;
|
16
16
|
}
|
@@ -73,7 +73,7 @@ let CloudWatchLoggerService = class CloudWatchLoggerService {
|
|
73
73
|
console.error('Error checking log stream:', error);
|
74
74
|
}
|
75
75
|
}
|
76
|
-
async sendAlerttoTeams(errorMessage, handler, input) {
|
76
|
+
async sendAlerttoTeams(errorMessage, handler, input, logStreamName) {
|
77
77
|
console.log("Error message", errorMessage);
|
78
78
|
const webhookUrl = this.teamWebhoookUrl;
|
79
79
|
const timestamp = new Date().toISOString();
|
@@ -103,7 +103,10 @@ let CloudWatchLoggerService = class CloudWatchLoggerService {
|
|
103
103
|
"name": "timestamp:",
|
104
104
|
"value": timestamp
|
105
105
|
},
|
106
|
-
|
106
|
+
{
|
107
|
+
"name": "Log link:",
|
108
|
+
"value": `[Click here for more details](https://eu-west-1.console.aws.amazon.com/cloudwatch/home?region=eu-west-1#logsV2:log-groups/log-group/${this.logGroupName}/log-events/${logStreamName})`
|
109
|
+
},
|
107
110
|
],
|
108
111
|
"markdown": true
|
109
112
|
}
|
@@ -168,7 +171,7 @@ let CloudWatchLoggerService = class CloudWatchLoggerService {
|
|
168
171
|
};
|
169
172
|
await this.logToCloudWatch('error', logObject, logStreamName);
|
170
173
|
if (this.isAlertNeeded) {
|
171
|
-
await this.sendAlerttoTeams(errorMessage, component, logObject);
|
174
|
+
await this.sendAlerttoTeams(errorMessage, component, logObject, logStreamName);
|
172
175
|
}
|
173
176
|
}
|
174
177
|
};
|
package/package.json
CHANGED