From a0f405e45ff5ee7dbbc3b2953ed3d4771e1190ba Mon Sep 17 00:00:00 2001 From: Dmitry S Date: Thu, 14 Jul 2022 02:01:08 -0400 Subject: [PATCH] (core) Include altSessionId in morgan request logging Summary: Most logging now includes altSessionId, but not the message logged at the end of every request by the 'morgan' logger. This includes altSessionId in those messages. Test Plan: Verified that with GRIST_HOSTED_VERSION env var set, altSessionId is included in morgan-produced JSON messages. Reviewers: georgegevoian Reviewed By: georgegevoian Subscribers: georgegevoian Differential Revision: https://phab.getgrist.com/D3523 --- app/server/lib/FlexServer.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/server/lib/FlexServer.ts b/app/server/lib/FlexServer.ts index 7fd2598f..53014dfa 100644 --- a/app/server/lib/FlexServer.ts +++ b/app/server/lib/FlexServer.ts @@ -327,7 +327,8 @@ export class FlexServer implements GristServer { status: tokens.status(req, res), timeMs: parseFloat(tokens['response-time'](req, res)) || undefined, contentLength: parseInt(tokens.res(req, res, 'content-length'), 10) || undefined, - host: tokens.host(req, res) + host: tokens.host(req, res), + altSessionId: req.altSessionId, }); } this.app.use(morganLogger(process.env.GRIST_HOSTED_VERSION ? outputJson : msg, {