+
+ it('Should filter by tag', async function () {
+ const now = new Date()
+
+ const { uuid } = await server.videos.upload({ attributes: { name: 'video 6' } })
+ await waitJobs([ server ])
+
+ {
+ const body = await logsCommand.getLogs({ startDate: now, level: 'debug', tagsOneOf: [ 'toto' ] })
+ expect(body).to.have.lengthOf(0)
+ }
+
+ {
+ const body = await logsCommand.getLogs({ startDate: now, level: 'debug', tagsOneOf: [ uuid ] })
+ expect(body).to.not.have.lengthOf(0)
+
+ for (const line of body) {
+ expect(line.tags).to.contain(uuid)
+ }
+ }
+ })
+
+ it('Should log ping requests', async function () {
+ this.timeout(10000)
+
+ const now = new Date()
+
+ await server.servers.ping()
+
+ const body = await logsCommand.getLogs({ startDate: now, level: 'info' })
+ const logsString = JSON.stringify(body)
+
+ expect(logsString.includes('/api/v1/ping')).to.be.true
+ })
+
+ it('Should not log ping requests', async function () {
+ this.timeout(30000)
+
+ await killallServers([ server ])
+
+ await server.run({ log: { log_ping_requests: false } })
+
+ const now = new Date()
+
+ await server.servers.ping()
+
+ const body = await logsCommand.getLogs({ startDate: now, level: 'info' })
+ const logsString = JSON.stringify(body)
+
+ expect(logsString.includes('/api/v1/ping')).to.be.false
+ })