slowlog.asciidoc 3.1 KB

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