(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
This commit is contained in:
Dmitry S 2022-07-14 02:01:08 -04:00
parent d221aeed24
commit a0f405e45f

View File

@ -327,7 +327,8 @@ export class FlexServer implements GristServer {
status: tokens.status(req, res), status: tokens.status(req, res),
timeMs: parseFloat(tokens['response-time'](req, res)) || undefined, timeMs: parseFloat(tokens['response-time'](req, res)) || undefined,
contentLength: parseInt(tokens.res(req, res, 'content-length'), 10) || 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, { this.app.use(morganLogger(process.env.GRIST_HOSTED_VERSION ? outputJson : msg, {