mirror of https://github.com/Chocobozzz/PeerTube
feat: allow administrator to disable logging of ping requests
parent
b7085c7132
commit
12c1e38df2
|
@ -100,6 +100,7 @@ log:
|
||||||
maxFileSize: 12MB
|
maxFileSize: 12MB
|
||||||
maxFiles: 20
|
maxFiles: 20
|
||||||
anonymizeIP: false
|
anonymizeIP: false
|
||||||
|
log_ping_requests: true
|
||||||
|
|
||||||
trending:
|
trending:
|
||||||
videos:
|
videos:
|
||||||
|
|
|
@ -100,6 +100,7 @@ log:
|
||||||
maxFileSize: 12MB
|
maxFileSize: 12MB
|
||||||
maxFiles: 20
|
maxFiles: 20
|
||||||
anonymizeIP: false
|
anonymizeIP: false
|
||||||
|
log_ping_requests: true
|
||||||
|
|
||||||
trending:
|
trending:
|
||||||
videos:
|
videos:
|
||||||
|
|
|
@ -158,7 +158,10 @@ morgan.token('user-agent', (req: express.Request) => {
|
||||||
return req.get('user-agent')
|
return req.get('user-agent')
|
||||||
})
|
})
|
||||||
app.use(morgan('combined', {
|
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' && CONFIG.LOG.LOG_PING_REQUESTS === false)
|
||||||
|
},
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// For body requests
|
// For body requests
|
||||||
|
|
|
@ -104,7 +104,8 @@ const CONFIG = {
|
||||||
MAX_FILE_SIZE: bytes.parse(config.get<string>('log.rotation.maxFileSize')),
|
MAX_FILE_SIZE: bytes.parse(config.get<string>('log.rotation.maxFileSize')),
|
||||||
MAX_FILES: config.get<number>('log.rotation.maxFiles')
|
MAX_FILES: config.get<number>('log.rotation.maxFiles')
|
||||||
},
|
},
|
||||||
ANONYMIZE_IP: config.get<boolean>('log.anonymizeIP')
|
ANONYMIZE_IP: config.get<boolean>('log.anonymizeIP'),
|
||||||
|
LOG_PING_REQUESTS: config.get<boolean>('log.log_ping_requests')
|
||||||
},
|
},
|
||||||
TRENDING: {
|
TRENDING: {
|
||||||
VIDEOS: {
|
VIDEOS: {
|
||||||
|
|
|
@ -42,6 +42,11 @@ smtp:
|
||||||
__format: "json"
|
__format: "json"
|
||||||
from_address: "PEERTUBE_SMTP_FROM"
|
from_address: "PEERTUBE_SMTP_FROM"
|
||||||
|
|
||||||
|
log:
|
||||||
|
log_ping_requests:
|
||||||
|
__name: "PEERTUBE_LOG_PING_REQUESTS"
|
||||||
|
__format: "json"
|
||||||
|
|
||||||
user:
|
user:
|
||||||
video_quota:
|
video_quota:
|
||||||
__name: "PEERTUBE_USER_VIDEO_QUOTA"
|
__name: "PEERTUBE_USER_VIDEO_QUOTA"
|
||||||
|
|
Loading…
Reference in New Issue