X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server.ts;h=66dcb3c400cb584df8a342f245785219b4960e84;hb=6559da2821cfa37717fb6f607f76a505d549cc74;hp=edfbab3d7f34a982aa3a623ffd65baca8ea594eb;hpb=75594f474a3e04086b37a014d23e89780ca67458;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server.ts b/server.ts index edfbab3d7..66dcb3c40 100644 --- a/server.ts +++ b/server.ts @@ -158,7 +158,8 @@ morgan.token('user-agent', (req: express.Request) => { return req.get('user-agent') }) app.use(morgan('combined', { - stream: { write: logger.info.bind(logger) } + stream: { write: logger.info.bind(logger) }, + skip: req => CONFIG.LOG.LOG_PING_REQUESTS === false && req.originalUrl === '/api/v1/ping' })) // For body requests @@ -204,7 +205,8 @@ app.use('/', staticRouter) app.use('/', lazyStaticRouter) // Client files, last valid routes! -if (cli.client) app.use('/', clientsRouter) +const cliOptions = cli.opts() +if (cliOptions.client) app.use('/', clientsRouter) // ----------- Errors ----------- @@ -276,14 +278,14 @@ async function startApplication () { updateStreamingPlaylistsInfohashesIfNeeded() .catch(err => logger.error('Cannot update streaming playlist infohashes.', { err })) - if (cli.plugins) await PluginManager.Instance.registerPluginsAndThemes() + if (cliOptions.plugins) await PluginManager.Instance.registerPluginsAndThemes() LiveManager.Instance.init() if (CONFIG.LIVE.ENABLED) LiveManager.Instance.run() // Make server listening server.listen(port, hostname, () => { - logger.info('Server listening on %s:%d', hostname, port) + logger.info('HTTP server listening on %s:%d', hostname, port) logger.info('Web server: %s', WEBSERVER.URL) Hooks.runAction('action:application.listening')