如何在Node.js中关闭Elasticsearch的注销?

Hou*_*man 5 logging node.js elasticsearch

我正在使用elasticsearchnpm模块.我收到恼人的黄色警告,因为我的弹性搜索服务器目前已关闭.

我怎样才能使它不记录任何东西?

小智 10

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

因此,如果您只是想要出现错误,那就是.

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

更多信息可以在配置页面上找到.不同的日志记录级别被发现在这里.

  • 链接已损坏 (2认同)