How do I turn logging off for Elasticsearch in Node.js? How do I turn logging off for Elasticsearch in Node.js? elasticsearch elasticsearch

How do I turn logging off for Elasticsearch in Node.js?


var client = new elasticsearch.Client({  log : [{    type: 'stdio',    levels: ['error', 'warning'] // change these options  }]});

So if you just wanted errors showing up it would be.

var client = new elasticsearch.Client({  log : [{    type: 'stdio',    levels: ['error'] // change these options  }]});

More can be found on config page. Different logging levels are found here (old link dead).

UPDATE: ES 7.x - logging has been removed:Breaking changes, Observability


I came to this thread because I was getting verbose logs for every elasticsearch query in the nodejs app I'm working on.

Turned out to be a package called elasticsearch-query-builder. It looks for an environment variable named VERBOSE_LOG, which I had to unset (i.e. to not set to false, which is a truthy string value)