- Elasticsearch - The Definitive Guide:
- Foreword
- Preface
- Getting Started
- You Know, for Search…
- Installing and Running Elasticsearch
- Talking to Elasticsearch
- Document Oriented
- Finding Your Feet
- Indexing Employee Documents
- Retrieving a Document
- Search Lite
- Search with Query DSL
- More-Complicated Searches
- Full-Text Search
- Phrase Search
- Highlighting Our Searches
- Analytics
- Tutorial Conclusion
- Distributed Nature
- Next Steps
- Life Inside a Cluster
- Data In, Data Out
- What Is a Document?
- Document Metadata
- Indexing a Document
- Retrieving a Document
- Checking Whether a Document Exists
- Updating a Whole Document
- Creating a New Document
- Deleting a Document
- Dealing with Conflicts
- Optimistic Concurrency Control
- Partial Updates to Documents
- Retrieving Multiple Documents
- Cheaper in Bulk
- Distributed Document Store
- Searching—The Basic Tools
- Mapping and Analysis
- Full-Body Search
- Sorting and Relevance
- Distributed Search Execution
- Index Management
- Inside a Shard
- You Know, for Search…
- Search in Depth
- Structured Search
- Full-Text Search
- Multifield Search
- Proximity Matching
- Partial Matching
- Controlling Relevance
- Theory Behind Relevance Scoring
- Lucene’s Practical Scoring Function
- Query-Time Boosting
- Manipulating Relevance with Query Structure
- Not Quite Not
- Ignoring TF/IDF
- function_score Query
- Boosting by Popularity
- Boosting Filtered Subsets
- Random Scoring
- The Closer, The Better
- Understanding the price Clause
- Scoring with Scripts
- Pluggable Similarity Algorithms
- Changing Similarities
- Relevance Tuning Is the Last 10%
- Dealing with Human Language
- Aggregations
- Geolocation
- Modeling Your Data
- Administration, Monitoring, and Deployment
WARNING: The 2.x versions of Elasticsearch have passed their EOL dates. If you are running a 2.x version, we strongly advise you to upgrade.
This documentation is no longer maintained and may be removed. For the latest information, see the current Elasticsearch documentation.
Logging
editLogging
editElasticsearch emits a number of logs, which are placed in ES_HOME/logs
.
The default logging level is INFO
. It provides a moderate amount of information,
but is designed to be rather light so that your logs are not enormous.
When debugging problems, particularly problems with node discovery (since this
often depends on finicky network configurations), it can be helpful to bump
up the logging level to DEBUG
.
You could modify the logging.yml
file and restart your nodes—but that is
both tedious and leads to unnecessary downtime. Instead, you can update logging
levels through the cluster-settings
API that we just learned about.
To do so, take the logger you are interested in and prepend logger.
to it. You can refer to the root logger as logger._root
.
Let’s turn up the discovery logging:
PUT /_cluster/settings { "transient" : { "logger.discovery" : "DEBUG" } }
While this setting is in effect, Elasticsearch will begin to emit DEBUG
-level
logs for the discovery
module.
Avoid TRACE
. It is extremely verbose, to the point where the logs
are no longer useful.
Slowlog
editThere is another log called the slowlog. The purpose of this log is to catch queries and indexing requests that take over a certain threshold of time. It is useful for hunting down user-generated queries that are particularly slow.
By default, the slowlog is not enabled. It can be enabled by defining the action
(query, fetch, or index), the level that you want the event logged at (WARN
, DEBUG
,
and so forth) and a time threshold.
This is an index-level setting, which means it is applied to individual indices:
PUT /my_index/_settings { "index.search.slowlog.threshold.query.warn" : "10s", "index.search.slowlog.threshold.fetch.debug": "500ms", "index.indexing.slowlog.threshold.index.info": "5s" }
Emit a |
|
Emit a |
|
Emit an |
You can also define these thresholds in your elasticsearch.yml
file. Indices
that do not have a threshold set will inherit whatever is configured in the
static config.
Once the thresholds are set, you can toggle the logging level like any other logger:
On this page