diff --git a/api/server.js b/api/server.js index 75a0f42..0c7a723 100644 --- a/api/server.js +++ b/api/server.js @@ -48,19 +48,24 @@ app.use(favicon(path.join(__dirname + '/..', 'public', 'favicon.ico'))); app.use(express.static(path.join(__dirname + '/..', 'public'))); app.use(bodyParser.json()); -// logging -if (process.env.NODE_ENV !== config.test.env) { - app.use(requestLogger('dev')); -} // API request checks for API-version and JSON etc. app.use(restAPIchecks); // Routes ****************************************************** -app.use(urls.auth, authenticateRouter); app.use(urls.signatures, signatureRouter); +// initialize logging here to exclude /signature requests +if (!process.env.NODE_ENV) { + // development logging + app.use(requestLogger('dev')); +} else if (process.env.NODE_ENV !== config.test.env) { + // production logging, apache style + app.use(requestLogger(':date :remote-addr :method :url :status :response-time ms')); +} + +app.use(urls.auth, authenticateRouter); app.use(urls.overview, overviewRouter); app.use(urls.users, userRouter); app.use(urls.squads, squadRouter);