summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2017-11-23 11:35:51 +0200
committerLauri Ojansivu <x@xet7.org>2017-11-23 11:35:51 +0200
commitcf045e3c3465912d9319cd7813ba74eeeead5361 (patch)
tree8f3390e022ee50bae18cd7cfb6229eaf1c85c000
parent674d45a81c94e0f862c9624b0f89743a5c675d89 (diff)
parent6575312e744038478612a8b76745c3d5b0928d70 (diff)
downloadwekan-cf045e3c3465912d9319cd7813ba74eeeead5361.tar.gz
wekan-cf045e3c3465912d9319cd7813ba74eeeead5361.tar.bz2
wekan-cf045e3c3465912d9319cd7813ba74eeeead5361.zip
Merge branch 'pierreozoux-fix-logger' into devel
Fix logger. Thanks to pierreozoux !
-rw-r--r--server/logger.js15
1 files changed, 6 insertions, 9 deletions
diff --git a/server/logger.js b/server/logger.js
index 70caa292..cb06682f 100644
--- a/server/logger.js
+++ b/server/logger.js
@@ -3,21 +3,20 @@ Meteor.startup(() => {
require('winston-zulip');
const fs = require('fs');
- const loggerEnable = process.env.LOGGER_ENABLE || false;
+ //remove default logger
+ Winston.remove(Winston.transports.Console);
+
+ const loggerEnable = process.env.LOGGER_ENABLE || true;
if (loggerEnable) {
Winston.log('info', 'logger is enable');
- const loggers = process.env.LOGGERS.split(',') || 'console';
- Winston.log('info', `Loggers selected : ${ process.env.LOGGERS }, if empty default is console`);
+ const loggers = process.env.LOGGERS ? process.env.LOGGERS.split(',') : 'console';
if (loggers.includes('console')) {
Winston.add(Winston.transports.Console, {
json: true,
timestamp: true,
});
- } else {
- //remove default logger
- Winston.remove(Winston.transports.Console);
}
if (loggers.includes('file')) {
@@ -57,10 +56,8 @@ Meteor.startup(() => {
Winston.log('info', `zulipconfig ${zulipConfig}`);
}
- } else {
- //remove default logger
- Winston.remove(Winston.transports.Console);
}
+
Winston.log('info', 'Logger is completly instanciate');
});