How to disable Elicsearch search in Node.js?

I am using the elasticsearchnpm module . I get annoying yellow warnings because my elasticsearch server is currently down.

How can I make it not record anything?

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

So, if you just wanted the errors to display, that would be.

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

More details can be found on the config page . Various logging levels are found here .

+10
source

I came to this topic because I received detailed logs for every elastic search request in the nodejs application that I am working on.

, elasticsearch-query-builder. VERBOSE_LOG, (.. false, )

0

Source: https://habr.com/ru/post/1548108/


All Articles