diff options
author | Chocobozzz <me@florianbigard.com> | 2021-03-05 13:26:02 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-03-24 18:18:40 +0100 |
commit | 452b3bea082481b84537e55c7cedc1e24860d543 (patch) | |
tree | edd6a3eb988b093abbcde9fd1890b7fa69d8f25f /server.ts | |
parent | d00717523890dfc90859a27921f20d79d101ae6e (diff) | |
download | PeerTube-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.ts | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 | }) |
162 | app.use(morgan('combined', { | 162 | app.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 | ||