Log client ID to gelf

This commit is contained in:
Andris Reinman 2020-03-22 16:30:54 +02:00
parent a44a946496
commit d6448df3f0
No known key found for this signature in database
GPG key ID: 5388A30A31834D83
2 changed files with 21 additions and 11 deletions

View file

@ -55,9 +55,17 @@ module.exports = {
this.id this.id
); );
let logdata = {
short_message: '[CLIENT ID]',
_mail_action: 'client_id',
_user: this.session && this.session.user && this.session.user.id && this.session.user.id.toString(),
_sess: this.id
};
Object.keys(clientId) Object.keys(clientId)
.sort((a, b) => allowedKeys.indexOf(a) - allowedKeys.indexOf(b)) .sort((a, b) => allowedKeys.indexOf(a) - allowedKeys.indexOf(b))
.forEach(key => { .forEach(key => {
logdata[`_client_id_${key}`] = clientId[key];
this._server.logger.info( this._server.logger.info(
{ {
tnx: 'id', tnx: 'id',
@ -70,6 +78,8 @@ module.exports = {
clientId[key] clientId[key]
); );
}); });
this._server.loggelf(logdata);
} }
// Create response ID serverIdList // Create response ID serverIdList

View file

@ -1,6 +1,6 @@
{ {
"name": "wildduck", "name": "wildduck",
"version": "1.23.5", "version": "1.23.6",
"description": "IMAP/POP3 server built with Node.js and MongoDB", "description": "IMAP/POP3 server built with Node.js and MongoDB",
"main": "server.js", "main": "server.js",
"scripts": { "scripts": {
@ -16,20 +16,20 @@
"license": "EUPL-1.1+", "license": "EUPL-1.1+",
"devDependencies": { "devDependencies": {
"ajv": "6.12.0", "ajv": "6.12.0",
"apidoc": "0.20.0", "apidoc": "0.20.1",
"browserbox": "0.9.1", "browserbox": "0.9.1",
"chai": "4.2.0", "chai": "4.2.0",
"eslint": "6.8.0", "eslint": "6.8.0",
"eslint-config-nodemailer": "1.2.0", "eslint-config-nodemailer": "1.2.0",
"eslint-config-prettier": "6.10.0", "eslint-config-prettier": "6.10.1",
"grunt": "1.0.4", "grunt": "1.1.0",
"grunt-cli": "1.3.2", "grunt-cli": "1.3.2",
"grunt-eslint": "22.0.0", "grunt-eslint": "22.0.0",
"grunt-mocha-test": "0.13.3", "grunt-mocha-test": "0.13.3",
"grunt-shell-spawn": "0.4.0", "grunt-shell-spawn": "0.4.0",
"grunt-wait": "0.3.0", "grunt-wait": "0.3.0",
"mailparser": "2.7.7", "mailparser": "2.7.7",
"mocha": "7.1.0", "mocha": "7.1.1",
"request": "2.88.2", "request": "2.88.2",
"supertest": "4.0.2" "supertest": "4.0.2"
}, },
@ -59,7 +59,7 @@
"mongodb": "3.5.5", "mongodb": "3.5.5",
"mongodb-extended-json": "1.11.0", "mongodb-extended-json": "1.11.0",
"node-forge": "0.9.1", "node-forge": "0.9.1",
"nodemailer": "6.4.5", "nodemailer": "6.4.6",
"npmlog": "4.1.2", "npmlog": "4.1.2",
"openpgp": "4.10.1", "openpgp": "4.10.1",
"pem": "1.14.4", "pem": "1.14.4",
@ -68,13 +68,13 @@
"restify": "8.5.1", "restify": "8.5.1",
"restify-logger": "2.0.1", "restify-logger": "2.0.1",
"seq-index": "1.1.0", "seq-index": "1.1.0",
"smtp-server": "3.5.0", "smtp-server": "3.6.0",
"speakeasy": "2.0.0", "speakeasy": "2.0.0",
"u2f": "0.1.3", "u2f": "0.1.3",
"utf7": "1.0.2", "utf7": "1.0.2",
"uuid": "7.0.2", "uuid": "7.0.2",
"wild-config": "1.5.0", "wild-config": "1.5.0",
"yargs": "15.3.0" "yargs": "15.3.1"
}, },
"repository": { "repository": {
"type": "git", "type": "git",