From fbec24bd50c65d27402466c944c926051b1ba9f1 Mon Sep 17 00:00:00 2001 From: Paul Rodwell Date: Sat, 13 Apr 2024 11:41:24 +0100 Subject: [PATCH] add vhost to log --- lib/server.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/server.coffee b/lib/server.coffee index 98844c3..ed4c5a1 100644 --- a/lib/server.coffee +++ b/lib/server.coffee @@ -184,7 +184,10 @@ module.exports = exports = (argv) -> # use logger, at least in development, probably needs a param to configure (or turn off). # use stream to direct to somewhere other than stdout. - app.use(logger('tiny')) + wikiName = new URL(argv.url).hostname + logger.token('vhost', () -> + return wikiName) + app.use(logger(':vhost :method :url :status :res[content-length] - :response-time ms')) app.use(cookieParser()) app.use(bodyParser.json({ limit: argv.uploadLimit})) app.use(bodyParser.urlencoded({ extended: true, limit: argv.uploadLimit}))