gpt4 book ai didi

logging - 执行MLT(更像这样)查询时,Elasticsearch中缺少日志记录

转载 作者:行者123 更新时间:2023-12-02 22:50:23 25 4
gpt4 key购买 nike

我在 ElasticSearch 中使用了更类似于查询的,问题是由于某种原因该查询未出现在日志文件中。我尝试了几种日志记录级别,例如DEBUG,INFO,但这并没有给我解决方案。

ElasticSearch Wiki也没有记录此类查询。

logging.yml

# you can override this using by setting a system property, for example -Des.logger.level=DEBUG
es.logger.level: DEBUG
rootLogger: ${es.logger.level}, console, file
logger:
# log action execution errors for easier debugging
action: DEBUG
# reduce the logging for aws, too much is logged under the default INFO
com.amazonaws: WARN

# gateway
#gateway: DEBUG
#index.gateway: DEBUG

# peer shard recovery
#indices.recovery: DEBUG

# discovery
#discovery: TRACE

index.search.slowlog: TRACE, index_search_slow_log_file
index.indexing.slowlog: TRACE, index_indexing_slow_log_file

additivity:
index.search.slowlog: false
index.indexing.slowlog: false

appender:
console:
type: console
layout:
type: consolePattern
conversionPattern: "[%d{ISO8601}][%-5p][%-25c{2}] %m%n"

file:
type: dailyRollingFile
file: ${path.logs}/${cluster.name}.log
datePattern: "'.'yyyy-MM-dd"
layout:
type: pattern
conversionPattern: "[%d{ISO8601}][%-5p][%-25c{2}] %m%n"

index_search_slow_log_file:
type: dailyRollingFile
file: ${path.logs}/${cluster.name}_index_search_slowlog.log
datePattern: "'.'yyyy-MM-dd"
layout:
type: pattern
conversionPattern: "[%d{ISO8601}][%-5p][%-25c{2}] %m%n"

index_indexing_slow_log_file:
type: dailyRollingFile
file: ${path.logs}/${cluster.name}_index_indexing_slowlog.log
datePattern: "'.'yyyy-MM-dd"
layout:
type: pattern
conversionPattern: "[%d{ISO8601}][%-5p][%-25c{2}] %m%n"

最佳答案

如果要查看ES服务器接收的more_like_this查询,可以通过确保将其下沉到slow log file来实现。为此,您只需要像这样调整elasticsearch.yml配置文件(最后)。取消注释以下行,并将值更改为非常低的值,例如1ms:

index.search.slowlog.threshold.query.trace: 1ms

重新启动ES服务器后,其效果是ES服务器收到的每个查询都将记录在慢日志文件中,包括 more_like_this查询。

关于logging - 执行MLT(更像这样)查询时,Elasticsearch中缺少日志记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34593088/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com