From 950911bde6bfe6c847e03fecc50e7526184b49d9 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Thu, 29 Jun 2023 15:50:34 -0700 Subject: [PATCH] Modern es client no longer has a built in logger Use pelias-elasticsearch for a client preconfigured to work with pelias-logger. --- config/defaults.json | 7 +------ test/expected-deep.json | 7 +------ test/generate.js | 8 ++++---- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/config/defaults.json b/config/defaults.json index 68987d3..e0e2e54 100644 --- a/config/defaults.json +++ b/config/defaults.json @@ -1,12 +1,7 @@ { "esclient": { "requestTimeout": "120000", - "nodes": ["http://localhost:9200"], - "log": [{ - "type": "stdio", - "json": false, - "level": [ "error", "warning" ] - }] + "nodes": ["http://localhost:9200"] }, "elasticsearch": { "settings": { diff --git a/test/expected-deep.json b/test/expected-deep.json index 313bd24..3a6ae26 100644 --- a/test/expected-deep.json +++ b/test/expected-deep.json @@ -1,12 +1,7 @@ { "esclient": { "requestTimeout": "120000", - "nodes": ["http://localhost:9200", "http://localhost:9300"], - "log": [{ - "type": "stdio", - "json": false, - "level": [ "error", "warning" ] - }] + "nodes": ["http://localhost:9200", "http://localhost:9300"] }, "elasticsearch": { "settings": { diff --git a/test/generate.js b/test/generate.js index 3e56453..c5ae934 100644 --- a/test/generate.js +++ b/test/generate.js @@ -16,7 +16,7 @@ module.exports.generate.development = function(test) { t.equal(typeof config, 'object', 'valid function'); t.deepEqual(c, defaults, 'defaults'); t.equal(typeof c.esclient, 'object', 'valid property'); - t.equal(Object.keys(c.esclient).length, 3, 'copied all default properties'); + t.equal(Object.keys(c.esclient).length, 2, 'copied all default properties'); t.equal(c.esclient.nodes.length, 1, 'defaults'); t.end(); @@ -52,7 +52,7 @@ module.exports.generate.production = function(test) { t.equal(typeof config, 'object', 'valid function'); t.notDeepEqual(c, defaults, 'valid function'); t.equal(typeof c.esclient, 'object', 'valid property'); - t.equal(Object.keys(c.esclient).length, 3, 'keep all default properties'); + t.equal(Object.keys(c.esclient).length, 2, 'keep all default properties'); t.equal(c.esclient.nodes.length, 2, 'deep merge should set two nodes'); t.end(); @@ -68,7 +68,7 @@ module.exports.generate.production = function(test) { t.equal(typeof config, 'object', 'valid function'); t.notDeepEqual(c, defaults, 'valid function'); t.equal(typeof c.esclient, 'object', 'valid property'); - t.equal(Object.keys(c.esclient).length, 3, 'keep all default properties'); + t.equal(Object.keys(c.esclient).length, 2, 'keep all default properties'); t.equal(c.esclient.nodes.length, 2, 'deep merge should set two nodes'); t.end(); @@ -103,7 +103,7 @@ module.exports.generate.local = function(test) { t.equal(typeof config, 'object', 'valid function'); t.notDeepEqual(c, defaults, 'valid function'); t.equal(typeof c.esclient, 'object', 'valid property'); - t.equal(Object.keys(c.esclient).length, 3, 'keep all default properties'); + t.equal(Object.keys(c.esclient).length, 2, 'keep all default properties'); t.equal(c.interpolation.client.adapter, 'http', 'interpolation client'); t.equal(c.interpolation.client.host, 'http://localhost:9999', 'interpolation client'); t.equal(c.imports.geonames.datapath, '/media/hdd', 'local paths');