@develit-io/backend-sdk 9.1.3 → 9.1.4
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/middlewares.mjs +5 -3
- package/package.json +1 -1
package/dist/middlewares.mjs
CHANGED
|
@@ -166,8 +166,9 @@ const logger = () => {
|
|
|
166
166
|
logRequest(requestLog);
|
|
167
167
|
if (!context.env.MIDDLEWARE_LOGGER_AUDITLOG_DISABLED) {
|
|
168
168
|
const userContext = context.get("user");
|
|
169
|
+
const requestId = uuidv4();
|
|
169
170
|
context.set("auditLog", {
|
|
170
|
-
requestId
|
|
171
|
+
requestId
|
|
171
172
|
});
|
|
172
173
|
await context.env.AUDITLOG_SERVICE.processLog({
|
|
173
174
|
type: "REQUEST",
|
|
@@ -181,7 +182,8 @@ const logger = () => {
|
|
|
181
182
|
ip: getRequestIpAddress(context.req),
|
|
182
183
|
userAgent: getRequestUserAgent(context.req)
|
|
183
184
|
},
|
|
184
|
-
logRecord: JSON.stringify(requestLog)
|
|
185
|
+
logRecord: JSON.stringify(requestLog),
|
|
186
|
+
requestId
|
|
185
187
|
});
|
|
186
188
|
}
|
|
187
189
|
}
|
|
@@ -191,7 +193,7 @@ const logger = () => {
|
|
|
191
193
|
const responseLog = await composeResponseLog(
|
|
192
194
|
response,
|
|
193
195
|
context.req.method,
|
|
194
|
-
context.req.
|
|
196
|
+
context.req.path
|
|
195
197
|
);
|
|
196
198
|
logResponse(responseLog);
|
|
197
199
|
if (!context.env.MIDDLEWARE_LOGGER_AUDITLOG_DISABLED) {
|