@nodefony/elastic-bundle
Advanced tools
Comparing version 6.0.1 to 6.1.0
{ | ||
"name": "@nodefony/elastic-bundle", | ||
"version": "6.0.1", | ||
"version": "6.1.0", | ||
"description": "Nodefony Framework Bundle elasticsearch ", | ||
"author": "admin admin@nodefony.com", | ||
"main": "elasticBundle.js", | ||
"scripts": {}, | ||
"private": false, | ||
"author": "Christophe CAMENSULI <ccamensuli@gmail.com>", | ||
"repository": {}, | ||
"keywords": [ | ||
@@ -13,11 +14,15 @@ "nodefony", | ||
], | ||
"repository": {}, | ||
"dependencies": { | ||
"@elastic/elasticsearch": "^7.9.1", | ||
"shortid": "^2.2.15" | ||
"@elastic/elasticsearch": "^7.10.0", | ||
"shortid": "^2.2.16" | ||
}, | ||
"devDependencies": { | ||
"node-pre-gyp": "^0.15.0" | ||
"node-pre-gyp": "^0.16.0" | ||
}, | ||
"license": "CECILL-B", | ||
"licenses": [ | ||
{ | ||
"type": "CECILL-B", | ||
"url": "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html" | ||
} | ||
], | ||
"readmeFilename": "README.md", | ||
@@ -24,0 +29,0 @@ "contributors": [ |
@@ -35,3 +35,3 @@ const elasticsearch = require('@elastic/elasticsearch'); | ||
logger(pci, severity, msgid, msg) { | ||
log(pci, severity, msgid, msg) { | ||
if (!msgid) { | ||
@@ -44,3 +44,3 @@ if (msg) { | ||
} | ||
return super.logger(pci, severity, msgid, msg); | ||
return super.log(pci, severity, msgid, msg); | ||
} | ||
@@ -55,3 +55,3 @@ | ||
//this.settings.log = logger; | ||
//this.settings.log.prototype.logger = this.logger.bind(this); | ||
//this.settings.log.prototype.logger = this.log.bind(this); | ||
//this.settings.ConnectionPool = MyConnectionPool; | ||
@@ -62,7 +62,7 @@ //this.settings.Connection = MyConnection; | ||
if (err) { | ||
this.logger(err, "ERROR"); | ||
this.logger(err.meta, "ERROR"); | ||
this.log(err, "ERROR"); | ||
this.log(err.meta, "ERROR"); | ||
return err; | ||
} | ||
this.logger(result.meta.request, "DEBUG", null, "REQUEST"); | ||
this.log(result.meta.request, "DEBUG", null, "REQUEST"); | ||
}); | ||
@@ -73,6 +73,6 @@ } | ||
if (err) { | ||
this.logger(err, "ERROR"); | ||
this.log(err, "ERROR"); | ||
return; | ||
} | ||
this.logger(result, "DEBUG", null, "RESPONSE"); | ||
this.log(result, "DEBUG", null, "RESPONSE"); | ||
}); | ||
@@ -83,6 +83,6 @@ } | ||
if (err) { | ||
this.logger(err, "ERROR"); | ||
this.log(err, "ERROR"); | ||
return; | ||
} | ||
this.logger(`${JSON.stringify(result.meta.sniff,null, '\t')}`, "DEBUG", null, "SNIFF"); | ||
this.log(`${JSON.stringify(result.meta.sniff,null, '\t')}`, "DEBUG", null, "SNIFF"); | ||
}); | ||
@@ -93,6 +93,6 @@ } | ||
if (err) { | ||
this.logger(err, "ERROR"); | ||
this.log(err, "ERROR"); | ||
return; | ||
} | ||
this.logger(result, "INFO", null, "RESURRECT"); | ||
this.log(result, "INFO", null, "RESURRECT"); | ||
}); | ||
@@ -160,10 +160,10 @@ } | ||
let conn = await this.createConnection(connection, options); | ||
this.logger(`Ping Elastic connection`, "INFO"); | ||
this.log(`Ping Elastic connection`, "INFO"); | ||
let ping = await conn.client.ping(); | ||
this.logger(ping, "DEBUG", ); | ||
this.logger(`Info Elastic connection`, "INFO"); | ||
this.log(ping, "DEBUG", ); | ||
this.log(`Info Elastic connection`, "INFO"); | ||
let info = await conn.client.info(); | ||
this.logger(info, "DEBUG"); | ||
this.log(info, "DEBUG"); | ||
} catch (e) { | ||
this.logger(e, "ERROR"); | ||
this.log(e, "ERROR"); | ||
continue; | ||
@@ -190,3 +190,3 @@ } | ||
table.push(data); | ||
this.logger(`${this.name} Connections : \n${table.toString()}`, severity); | ||
this.log(`${this.name} Connections : \n${table.toString()}`, severity); | ||
} catch (e) { | ||
@@ -236,2 +236,2 @@ throw e; | ||
nodefony.services.Elastic = Elastic; | ||
module.exports = Elastic; | ||
module.exports = Elastic; |
module.exports = class classElasticLog { | ||
constructor(config) { | ||
this.logger("INIT SYSLOG ELASTIC ", "INFO"); | ||
this.log("INIT SYSLOG ELASTIC ", "INFO"); | ||
this.config = config; | ||
@@ -11,3 +11,3 @@ } | ||
case "error": | ||
return this.logger(data, "ERROR"); | ||
return this.log(data, "ERROR"); | ||
default: | ||
@@ -21,7 +21,7 @@ console.log(data); | ||
case "string": | ||
return this.logger(data, "WARNING"); | ||
return this.log(data, "WARNING"); | ||
default: | ||
try { | ||
let str = JSON.stringify(data); | ||
return this.logger(str, "WARNING"); | ||
return this.log(str, "WARNING"); | ||
} catch (e) { | ||
@@ -46,3 +46,3 @@ console.log(data); | ||
} | ||
return this.logger(res, "INFO"); | ||
return this.log(res, "INFO"); | ||
} catch (e) { | ||
@@ -66,3 +66,3 @@ console.log(e); | ||
} | ||
return this.logger(res, "DEBUG"); | ||
return this.log(res, "DEBUG"); | ||
} catch (e) { | ||
@@ -82,5 +82,5 @@ console.log(e); | ||
let str = JSON.stringify(ele, null, " "); | ||
this.logger(str, "DEBUG"); | ||
this.log(str, "DEBUG"); | ||
if (responseBody) { | ||
this.logger(JSON.stringify(JSON.parse(responseBody), null, " "), "DEBUG", `${ele.method} : ${ele.url}`); | ||
this.log(JSON.stringify(JSON.parse(responseBody), null, " "), "DEBUG", `${ele.method} : ${ele.url}`); | ||
} | ||
@@ -91,2 +91,2 @@ } catch (e) { | ||
} | ||
}; | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21726
454
Updatedshortid@^2.2.16