From 76f6bbbc0d7b2d3c20e6359a1cf8a0fb818c9689 Mon Sep 17 00:00:00 2001 From: Jack Foltz Date: Mon, 13 Aug 2018 06:43:31 -0400 Subject: [PATCH] Add conditional http logging --- config/default.json | 1 + config/travisci.json | 2 +- server.js | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/default.json b/config/default.json index 4966fec..ffefc06 100644 --- a/config/default.json +++ b/config/default.json @@ -32,6 +32,7 @@ "limit": 5 }, "Log": { + "http": true, "httpLevel": "combined" } } diff --git a/config/travisci.json b/config/travisci.json index b5718b7..4582b31 100644 --- a/config/travisci.json +++ b/config/travisci.json @@ -10,7 +10,7 @@ "path": "uploads" }, "Log": { - "httpLevel": "dev" + "http": false }, "User": { "Password": { diff --git a/server.js b/server.js index 8ef1e20..90b0002 100755 --- a/server.js +++ b/server.js @@ -29,7 +29,8 @@ const MongoStore = require('connect-mongo')(session); const mongoStore = new MongoStore({url: dbHost}); // HTTP Request Logging -app.use(morgan(config.get('Log.httpLevel'))); +if (config.get('Log.http')) + app.use(morgan(config.get('Log.httpLevel'))); // Session setup app.use(helmet());