Skip to content

Commit 8a580ec

Browse files
authored
Merge pull request #1306 from guardian/tf-log-auxia
Log auxiaTreatmentId
2 parents dec0567 + 3450d26 commit 8a580ec

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/server/api/auxiaProxyRouter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ export const buildAuxiaProxyRouter = (config: AuxiaRouterConfig): Router => {
199199

200200
if (auxiaData !== undefined) {
201201
const data = buildAuxiaProxyGetTreatmentsResponseData(auxiaData);
202+
res.locals.auxiaTreatmentId = data?.userTreatment?.treatmentId;
202203
res.send({ status: true, data: data });
203204
} else {
204205
res.send({ status: false });
@@ -232,6 +233,7 @@ export const buildAuxiaProxyRouter = (config: AuxiaRouterConfig): Router => {
232233
req.body.interactionTimeMicros,
233234
req.body.actionName,
234235
);
236+
res.locals.auxiaTreatmentId = req.body.treatmentId;
235237
res.send({ status: true }); // this is the proxy's response, slightly more user's friendly than the api's response.
236238
} catch (error) {
237239
next(error);

src/server/middleware/logging.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const logging = (
2323
userAgent: isServerError(res.statusCode) ? req.headers['user-agent'] : undefined,
2424
epicSuperMode: res.locals.epicSuperMode,
2525
responseTimeInMs: Math.round(responseTimeMs),
26+
auxiaTreatmentId: res.locals.auxiaTreatmentId,
2627
});
2728
});
2829
next();

0 commit comments

Comments
 (0)