aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-03-05 13:26:02 +0100
committerChocobozzz <me@florianbigard.com>2021-03-24 18:18:40 +0100
commit452b3bea082481b84537e55c7cedc1e24860d543 (patch)
treeedd6a3eb988b093abbcde9fd1890b7fa69d8f25f /server.ts
parentd00717523890dfc90859a27921f20d79d101ae6e (diff)
downloadPeerTube-452b3bea082481b84537e55c7cedc1e24860d543.tar.gz
PeerTube-452b3bea082481b84537e55c7cedc1e24860d543.tar.zst
PeerTube-452b3bea082481b84537e55c7cedc1e24860d543.zip
Introduce tags to the logger
That could help to filter unneeded logs and/or select particular components
Diffstat (limited to 'server.ts')
-rw-r--r--server.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/server.ts b/server.ts
index 00cd87e20..1cc29209e 100644
--- a/server.ts
+++ b/server.ts
@@ -160,7 +160,9 @@ morgan.token('user-agent', (req: express.Request) => {
160 return req.get('user-agent') 160 return req.get('user-agent')
161}) 161})
162app.use(morgan('combined', { 162app.use(morgan('combined', {
163 stream: { write: logger.info.bind(logger) }, 163 stream: {
164 write: (str: string) => logger.info(str, { tags: [ 'http' ] })
165 },
164 skip: req => CONFIG.LOG.LOG_PING_REQUESTS === false && req.originalUrl === '/api/v1/ping' 166 skip: req => CONFIG.LOG.LOG_PING_REQUESTS === false && req.originalUrl === '/api/v1/ping'
165})) 167}))
166 168