Skip to content

Commit

Permalink
Modern es client no longer has a built in logger
Browse files Browse the repository at this point in the history
Use pelias-elasticsearch for a client preconfigured to work with
pelias-logger.
  • Loading branch information
michaelkirk committed Jun 29, 2023
1 parent 0dec536 commit 7fbd9c0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
7 changes: 1 addition & 6 deletions config/defaults.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
7 changes: 1 addition & 6 deletions test/expected-deep.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
8 changes: 4 additions & 4 deletions test/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand All @@ -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();

Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 7fbd9c0

Please sign in to comment.