Skip to content

Commit

Permalink
add wiki name to log
Browse files Browse the repository at this point in the history
  • Loading branch information
paul90 committed Apr 13, 2024
1 parent 9e3b89b commit d7b082d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/server.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,12 @@ module.exports = exports = (argv) ->
app.engine('html', hbs.express4())
app.set('view options', layout: false)

# use logger, at least in development, probably needs a param to configure (or turn off).
# use morgan, 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
morgan.token('vhost', () ->
return wikiName)
app.use(morgan(':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}))
Expand Down

0 comments on commit d7b082d

Please sign in to comment.