diff options
-rw-r--r-- | .eslintrc.json | 2 | ||||
-rw-r--r-- | CHANGELOG.md | 8 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | server/logger.js | 63 | ||||
-rw-r--r-- | server/observableChanges.js | 100 |
5 files changed, 8 insertions, 167 deletions
diff --git a/.eslintrc.json b/.eslintrc.json index b93dd916..a6d651a5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -52,7 +52,6 @@ "prefer-const": 2, "prefer-spread": 2, "prefer-template": 2, - "no-console": 0, "no-unused-vars" : "warn" }, "globals": { @@ -125,7 +124,6 @@ "Checklists": true, "Settings": true, "InvitationCodes": true, - "Winston":true, "JsonRoutes": true, "Authentication": true, "Integrations": true, diff --git a/CHANGELOG.md b/CHANGELOG.md index 84092412..f6875486 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# v0.59 2017-11-23 Wekan release. + +This release fixes the following bugs: + +* [Fix not working stdout logging by removing Winston logger](https://github.com/wekan/wekan/pull/1352). + +Thanks to GitHub user pierreozoux for contributions. + # v0.58 2017-11-23 Wekan release This release adds the following new features: diff --git a/package.json b/package.json index 240acf2c..b0e886ff 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,6 @@ "es6-promise": "^4.1.0", "meteor-node-stubs": "^0.2.6", "os": "^0.1.1", - "winston": "^2.3.1", - "winston-zulip": "0.0.6", "xss": "^0.3.3" } } diff --git a/server/logger.js b/server/logger.js deleted file mode 100644 index cb06682f..00000000 --- a/server/logger.js +++ /dev/null @@ -1,63 +0,0 @@ -Meteor.startup(() => { - Winston = require('winston'); - require('winston-zulip'); - const fs = require('fs'); - - //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 ? process.env.LOGGERS.split(',') : 'console'; - - if (loggers.includes('console')) { - Winston.add(Winston.transports.Console, { - json: true, - timestamp: true, - }); - } - - if (loggers.includes('file')) { - //create logs directory - fs.mkdir('logs', (err) => { - if (err) throw err; - }); - - const fileName = `logs/${process.env.LOGGER_FILE_NAME}` || 'logs/server.log'; - - Winston.add(Winston.transports.File, { - filename: fileName, - json: true, - options: { - flags: 'a+', - }, - }); - } - - if (loggers.includes('zulip')) { - const loggerZulipUsername = process.env.LOGGER_ZULIP_USERNAME; - const loggerZulipApikey = process.env.LOGGER_ZULIP_APIKEY; - const loggerZulipRealm = process.env.LOGGER_ZULIP_REALM; - const loggerZulipTo = process.env.LOGGER_ZULIP_TO || 'logs'; - const loggerZulipSubject = process.env.LOGGER_ZULIP_SUBJECT || 'wekan'; - - const zulipConfig = { - zulipUsername: loggerZulipUsername, - zulipApikey: loggerZulipApikey, - zulipRealm: loggerZulipRealm, - zulipTo: loggerZulipTo, - zulipSubject: loggerZulipSubject, - }; - - Winston.add(Winston.transports.Zulip, zulipConfig); - - Winston.log('info', `zulipconfig ${zulipConfig}`); - } - - } - - Winston.log('info', 'Logger is completly instanciate'); -}); - diff --git a/server/observableChanges.js b/server/observableChanges.js deleted file mode 100644 index 390ae093..00000000 --- a/server/observableChanges.js +++ /dev/null @@ -1,100 +0,0 @@ -class Message { - constructor(userId, type, method, doc, selector, fieldNames, modifier) { - this.userId = userId; - this.type = type; - this.method = method; - this.doc = doc; - this.selector; - this.fieldNames = fieldNames; - this.modifier = modifier; - } - -} - -//------------- CARDS -------------------- -Cards.before.update(function (userId, doc, fieldNames, modifier, options) { - Winston.log('info', new Message(userId, 'card', 'update', doc, null, fieldNames, modifier)); -}); - -Cards.before.remove(function (userId, doc) { - Winston.log('info', new Message(userId, 'card', 'remove', doc)); -}); - -Cards.before.insert(function (userId, doc) { - Winston.log('info', new Message(userId, 'card', 'insert', doc)); -}); - -Cards.before.upsert(function (userId, selector, modifier, options) { - Winston.log('info', new Message(userId, 'card', 'update', null, selector, null, modifier)); -}); - - -//------------- BOARDS -------------------- -Boards.before.update(function (userId, doc, fieldNames, modifier, options) { - Winston.log('info', new Message(userId, 'board', 'update', doc, null, fieldNames, modifier)); -}); - -Boards.before.remove(function (userId, doc) { - Winston.log('info', new Message(userId, 'board', 'remove', doc)); -}); - -Boards.before.insert(function (userId, doc) { - Winston.log('info', new Message(userId, 'board', 'insert', doc)); -}); - -Boards.before.upsert(function (userId, selector, modifier, options) { - Winston.log('info', new Message(userId, 'board', 'update', null, selector, null, modifier)); -}); - -//------------- LISTS -------------------- -Lists.before.update(function (userId, doc, fieldNames, modifier, options) { - Winston.log('info', new Message(userId, 'list', 'update', doc, null, fieldNames, modifier)); -}); - -Lists.before.remove(function (userId, doc) { - Winston.log('info', new Message(userId, 'list', 'remove', doc)); -}); - -Lists.before.insert(function (userId, doc) { - Winston.log('info', new Message(userId, 'list', 'insert', doc)); -}); - -Lists.before.upsert(function (userId, selector, modifier, options) { - Winston.log('info', new Message(userId, 'list', 'update', null, selector, null, modifier)); -}); - - -//------------- CARD COMMENTS -------------------- -CardComments.before.update(function (userId, doc, fieldNames, modifier, options) { - Winston.log('info', new Message(userId, 'card-comments', 'update', doc, null, fieldNames, modifier)); -}); - -CardComments.before.remove(function (userId, doc) { - Winston.log('info', new Message(userId, 'card-comments', 'remove', doc)); -}); - -CardComments.before.insert(function (userId, doc) { - Winston.log('info', new Message(userId, 'card-comments', 'insert', doc)); -}); - -CardComments.before.upsert(function (userId, selector, modifier, options) { - Winston.log('info', new Message(userId, 'card-comments', 'update', null, selector, null, modifier)); -}); - - -//------------- USERS -------------------- -Users.before.update(function (userId, doc, fieldNames, modifier, options) { - Winston.log('info', new Message(userId, 'user', 'update', doc, null, fieldNames, modifier)); -}); - -Users.before.remove(function (userId, doc) { - Winston.log('info', new Message(userId, 'user', 'remove', doc)); -}); - -Users.before.insert(function (userId, doc) { - Winston.log('info', new Message(userId, 'user', 'insert', doc)); -}); - -Users.before.upsert(function (userId, selector, modifier, options) { - Winston.log('info', new Message(userId, 'user', 'update', null, selector, null, modifier)); -}); |