为ElasticSearch Java Rest Client的跟踪程序包禁用跟踪日志记录

时间:2018-08-15 20:21:19

标签: elasticsearch apache-commons apache-commons-logging

我正在通过ElasticSearch 6.3 Java Rest Client进行批量索引操作。

数据已正确建立索引,但是restclient在文件中打印大量日志。见下文:

2018-08-14 16:25:42,614 DEBUG [User=] [tracer] curl -iX POST 'http://1.2.3.4:9202/_bulk?timeout=1m' -d '{"create":{"_index":"ms","_type":"doc","_id":"24218000","version":-4}}
{"create":{"_index":"ms","_type":"doc","_id":"24217999","version":-4}}
{"data":"test","year":2018,"corrid":"24217999","mode":"USPS","emailaddress":"","mimeType":"application/octet-stream","title":"some title","type":"app","maildate":"2018-01-02","code":"abx","direction":"out","quarter":0,"no":"222876"}
{"create":{"_index":"ms","_type":"doc","_id":"24218345","version":-4

如何禁用或限制它?

This文档仅讨论了一点,但没有给出足够的信息。

1 个答案:

答案 0 :(得分:1)

我同意他们的文件含糊不清。

听起来您输入的内容类似

00000000.swf

<logger name="tracer" level="TRACE" additivity="false">
  <appender-ref ref="CONSOLE" />
</logger>

tracer.level=TRACE 配置中的某处被导入。至少,我认为您可以将级别设置为commons-loggingWARN以使chat不休。

如xeraa所述,您可能还为ERRORorg.elasticsearch.clientorg.elasticsearch.client.RestClient等设置了较高的记录器级别。