@uoa/lambda-tracing 1.5.0 → 1.6.0
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.
- package/dist/logging.js +5 -1
- package/logging.ts +6 -1
- package/package.json +1 -1
package/dist/logging.js
CHANGED
|
@@ -41,6 +41,10 @@ function getLogReplacementValues(callingModule, logInfo) {
|
|
|
41
41
|
else if (infoHeader) {
|
|
42
42
|
info = infoHeader.toString();
|
|
43
43
|
}
|
|
44
|
+
let message = '-';
|
|
45
|
+
if (logInfo.message != null) {
|
|
46
|
+
message = logInfo.message;
|
|
47
|
+
}
|
|
44
48
|
const traceIdLength = context.active().getValue(UoaB3Propagator_1.B3_TRACE_ID_LENGTH_KEY);
|
|
45
49
|
let logReplacements = new Map();
|
|
46
50
|
logReplacements.set('%date', moment().toISOString());
|
|
@@ -50,7 +54,7 @@ function getLogReplacementValues(callingModule, logInfo) {
|
|
|
50
54
|
logReplacements.set('%traceId', traceId.slice(traceId.length - traceIdLength));
|
|
51
55
|
logReplacements.set('%spanId', spanId);
|
|
52
56
|
logReplacements.set('%info', info);
|
|
53
|
-
logReplacements.set('%message',
|
|
57
|
+
logReplacements.set('%message', message.replace(/\n/g, ''));
|
|
54
58
|
return logReplacements;
|
|
55
59
|
}
|
|
56
60
|
module.exports = function (callingModule) {
|
package/logging.ts
CHANGED
|
@@ -47,6 +47,11 @@ function getLogReplacementValues(callingModule: NodeModule, logInfo: any): Map<s
|
|
|
47
47
|
info = infoHeader.toString();
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
let message = '-';
|
|
51
|
+
if (logInfo.message != null) {
|
|
52
|
+
message = logInfo.message;
|
|
53
|
+
}
|
|
54
|
+
|
|
50
55
|
const traceIdLength: number = <number>context.active().getValue(B3_TRACE_ID_LENGTH_KEY);
|
|
51
56
|
|
|
52
57
|
let logReplacements: Map<string, string> = new Map<string, string>();
|
|
@@ -57,7 +62,7 @@ function getLogReplacementValues(callingModule: NodeModule, logInfo: any): Map<s
|
|
|
57
62
|
logReplacements.set('%traceId', traceId.slice(traceId.length - traceIdLength));
|
|
58
63
|
logReplacements.set('%spanId', spanId);
|
|
59
64
|
logReplacements.set('%info', info);
|
|
60
|
-
logReplacements.set('%message',
|
|
65
|
+
logReplacements.set('%message', message.replace(/\n/g, ''));
|
|
61
66
|
|
|
62
67
|
return logReplacements;
|
|
63
68
|
}
|