From 282a0f3be57caf6fbade331e15784b35392cb5c0 Mon Sep 17 00:00:00 2001 From: Johan Fleury Date: Thu, 7 Jan 2021 16:52:37 -0500 Subject: [PATCH] feat: allow to not log ping requests --- server.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server.ts b/server.ts index edfbab3d7f34..bc8d93cc582c 100644 --- a/server.ts +++ b/server.ts @@ -158,7 +158,10 @@ morgan.token('user-agent', (req: express.Request) => { return req.get('user-agent') }) app.use(morgan('combined', { - stream: { write: logger.info.bind(logger) } + stream: { write: logger.info.bind(logger) }, + skip: function (req, res) { + return (req.path === '/api/v1/ping' && req.query.silent === 'true') + }, })) // For body requests