diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index 509dbcc026..a7d4e6d27b 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -3,13 +3,14 @@ request = require('request') module.exports = Logger = initialize: (name) -> - @defaultLevel = process.env['LOG_LEVEL'] or if process.env["NODE_ENV"] == 'production' then "warn" else "debug" + isProduction = process.env['NODE_ENV']?.toLowerCase() == 'production' + @defaultLevel = process.env['LOG_LEVEL'] or if isProduction then "warn" else "debug" @loggerName = name @logger = bunyan.createLogger name: name serializers: bunyan.stdSerializers level: @defaultLevel - if process.env["NODE_ENV"] == 'production' + if isProduction # check for log level override on startup @.checkLogLevel() # re-check log level every minute diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 69f5260d40..96d8d7dd8a 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.5.9", + "version": "1.6.0", "scripts": { "test": "mocha --require coffee-script/register test/**/*.coffee" },