mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-19 20:34:44 +00:00
Allow disabling logger in non-prod for testing
This commit is contained in:
parent
4044b0cb64
commit
2cc4d65d78
1 changed files with 2 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ utils.setupConfig();
|
|||
var logging = require('./logging');
|
||||
var isProd = nconf.get('NODE_ENV') === 'production';
|
||||
var isDev = nconf.get('NODE_ENV') === 'development';
|
||||
var DISABLE_LOGGING = nconf.get('DISABLE_REQUEST_LOGGING');
|
||||
var cores = +nconf.get("WEB_CONCURRENCY") || 0;
|
||||
|
||||
if (cores!==0 && cluster.isMaster && (isDev || isProd)) {
|
||||
|
|
@ -91,7 +92,7 @@ if (cores!==0 && cluster.isMaster && (isDev || isProd)) {
|
|||
app.set("port", nconf.get('PORT'));
|
||||
require('./middlewares/apiThrottle')(app);
|
||||
app.use(require('./middlewares/domain')(server,mongoose));
|
||||
if (!isProd) app.use(express.logger("dev"));
|
||||
if (!isProd && !DISABLE_LOGGING) app.use(express.logger("dev"));
|
||||
app.use(express.compress());
|
||||
app.set("views", __dirname + "/../views");
|
||||
app.set("view engine", "jade");
|
||||
|
|
|
|||
Loading…
Reference in a new issue