diff options
author | Johan Fleury <jfleury@arcaik.net> | 2021-01-07 16:52:37 -0500 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-01-13 09:14:43 +0100 |
commit | 12c1e38df2fde0efbf948fa80e2afc4e67f0e8c9 (patch) | |
tree | 004d31846c078f6e13622fbf2bf0b28bd0db47ea /server.ts | |
parent | b7085c713220c9c5a96c9bb77330c2ba6ae9274e (diff) | |
download | PeerTube-12c1e38df2fde0efbf948fa80e2afc4e67f0e8c9.tar.gz PeerTube-12c1e38df2fde0efbf948fa80e2afc4e67f0e8c9.tar.zst PeerTube-12c1e38df2fde0efbf948fa80e2afc4e67f0e8c9.zip |
feat: allow administrator to disable logging of ping requests
Diffstat (limited to 'server.ts')
-rw-r--r-- | server.ts | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -158,7 +158,10 @@ morgan.token('user-agent', (req: express.Request) => { | |||
158 | return req.get('user-agent') | 158 | return req.get('user-agent') |
159 | }) | 159 | }) |
160 | app.use(morgan('combined', { | 160 | app.use(morgan('combined', { |
161 | stream: { write: logger.info.bind(logger) } | 161 | stream: { write: logger.info.bind(logger) }, |
162 | skip: function (req, res) { | ||
163 | return (req.path === '/api/v1/ping' && CONFIG.LOG.LOG_PING_REQUESTS === false) | ||
164 | }, | ||
162 | })) | 165 | })) |
163 | 166 | ||
164 | // For body requests | 167 | // For body requests |