slowlog.asciidoc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. [[index-modules-slowlog]]
  2. == Index Slow Log
  3. [float]
  4. [[search-slow-log]]
  5. === Search Slow Log
  6. Shard level slow search log allows to log slow search (query and fetch
  7. executions) into a dedicated log file.
  8. Thresholds can be set for both the query phase of the execution, and
  9. fetch phase, here is a sample:
  10. [source,js]
  11. --------------------------------------------------
  12. #index.search.slowlog.threshold.query.warn: 10s
  13. #index.search.slowlog.threshold.query.info: 5s
  14. #index.search.slowlog.threshold.query.debug: 2s
  15. #index.search.slowlog.threshold.query.trace: 500ms
  16. #index.search.slowlog.threshold.fetch.warn: 1s
  17. #index.search.slowlog.threshold.fetch.info: 800ms
  18. #index.search.slowlog.threshold.fetch.debug: 500ms
  19. #index.search.slowlog.threshold.fetch.trace: 200ms
  20. --------------------------------------------------
  21. By default, none are enabled (set to `-1`). Levels (`warn`, `info`,
  22. `debug`, `trace`) allow to control under which logging level the log
  23. will be logged. Not all are required to be configured (for example, only
  24. `warn` threshold can be set). The benefit of several levels is the
  25. ability to quickly "grep" for specific thresholds breached.
  26. The logging is done on the shard level scope, meaning the execution of a
  27. search request within a specific shard. It does not encompass the whole
  28. search request, which can be broadcast to several shards in order to
  29. execute. Some of the benefits of shard level logging is the association
  30. of the actual execution on the specific machine, compared with request
  31. level.
  32. All settings are index level settings (and each index can have different
  33. values for it), and can be changed in runtime using the index update
  34. settings API.
  35. The logging file is configured by default using the following
  36. configuration (found in `logging.yml`):
  37. [source,js]
  38. --------------------------------------------------
  39. index_search_slow_log_file:
  40. type: dailyRollingFile
  41. file: ${path.logs}/${cluster.name}_index_search_slowlog.log
  42. datePattern: "'.'yyyy-MM-dd"
  43. layout:
  44. type: pattern
  45. conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
  46. --------------------------------------------------
  47. [float]
  48. [[index-slow-log]]
  49. === Index Slow log
  50. p.The indexing slow log, similar in functionality to the search slow
  51. log. The log file is ends with `_index_indexing_slowlog.log`. Log and
  52. the thresholds are configured in the elasticsearch.yml file in the same
  53. way as the search slowlog. Index slowlog sample:
  54. [source,js]
  55. --------------------------------------------------
  56. #index.indexing.slowlog.threshold.index.warn: 10s
  57. #index.indexing.slowlog.threshold.index.info: 5s
  58. #index.indexing.slowlog.threshold.index.debug: 2s
  59. #index.indexing.slowlog.threshold.index.trace: 500ms
  60. --------------------------------------------------
  61. The index slow log file is configured by default in the `logging.yml`
  62. file:
  63. [source,js]
  64. --------------------------------------------------
  65. index_indexing_slow_log_file:
  66. type: dailyRollingFile
  67. file: ${path.logs}/${cluster.name}_index_indexing_slowlog.log
  68. datePattern: "'.'yyyy-MM-dd"
  69. layout:
  70. type: pattern
  71. conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
  72. --------------------------------------------------