elasticsearch

目標是要將

  file:
    type: dailyRollingFile
    file: ${path.logs}/${cluster.name}.log
    datePattern: "'.'yyyy-MM-dd"
    layout:
      type: pattern
      conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %.10000m%n"
修改為
  file:
    type: rollingFile
    file: ${path.logs}/${cluster.name}.log
    maxFileSize: 8000KB
    maxBackupIndex: 10
    layout:
      type: pattern
      conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %.10000m%n"
ant內容如下:
<replaceregexp file="config/logging.yml" match="type: dailyRollingFile" replace="type: rollingFile${line.separator}    maxFileSize: 8000KB${line.separator}    maxBackupIndex: 10" flags="g"/>
<replaceregexp file="config/logging.yml" match="[ \t]*datePattern: .*[\r\n]*" replace="" flags="g"/>

在使用預設的loggin.yml情況下,新增以下內容到elasticsearch.yml:

index.search.slowlog.threshold.query.debug: 0s
index.search.slowlog.threshold.fetch.debug: 0s
index.indexing.slowlog.threshold.index.debug: 0s
接著使用rest client去操作elasticsearch:
curl http://127.0.0.1:9200/_search
最後就可以查看index_search_slowlog.log的內容;裡面要有資料才會有log產生。