Reputation: 14250
How to log requests which came to elasticsearch?
I set in elasticsearch/bin/service/elasticsearch.conf
:
wrapper.logfile=/var/log/elasticsearch/debug.log
# Log Level for log file output. (See docs for log levels)
wrapper.logfile.loglevel=DEBUG
But the log file shows only:
STATUS | wrapper | 2012/12/11 13:00:00 | TERM trapped. Shutting down.
STATUS | wrapper | 2012/12/11 13:00:02 | <-- Wrapper Stopped
STATUS | wrapper | 2012/12/11 13:00:05 | --> Wrapper Started as Daemon
STATUS | wrapper | 2012/12/11 13:00:05 | Java Service Wrapper Community Edition 64-bit 3.5.6
STATUS | wrapper | 2012/12/11 13:00:05 | Copyright (C) 1999-2010 Tanuki Software, Ltd. All Rights Reserved.
STATUS | wrapper | 2012/12/11 13:00:05 | http://wrapper.tanukisoftware.com
STATUS | wrapper | 2012/12/11 13:00:05 |
WARN | wrapper | 2012/12/11 13:00:05 | The value of wrapper.java.command does not appear to be a java binary.
WARN | wrapper | 2012/12/11 13:00:05 | The use of scripts is not supported. Trying to continue, but some features may not work correctly..
STATUS | wrapper | 2012/12/11 13:00:05 | Launching a JVM...
INFO | jvm 1 | 2012/12/11 13:00:05 | WrapperManager: Initializing...
No info about my requests...
I use elasticsearch 0.17.6
Upvotes: 21
Views: 31849
Reputation: 1100
The preferred way to configure logging in Elasticsearch 5.x and above is using the API:
## Elasticsearch slow log
curl -X "PUT" "http://localhost:9200/test_resumes/_settings?preserve_existing=true" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"index": {
"search.slowlog.threshold.query.trace": "0ms",
"search.slowlog.threshold.fetch.trace": "0ms",
"search.slowlog.level": "trace"
}
}'
Upvotes: 4
Reputation: 4263
In 1.7.3
config/elasticsearch.yml
index.search.slowlog.threshold.query.debug: 0s
index.search.slowlog.threshold.fetch.debug: 0s
index.indexing.slowlog.threshold.index.debug: 0s
and
config/logging.yml
index.search.slowlog: DEBUG, index_search_slow_log_file
index.indexing.slowlog: DEBUG, index_indexing_slow_log_file
additivity:
index.search.slowlog: true
index.indexing.slowlog: true
Upvotes: 4
Reputation: 30163
There are no request logging facilities available in elasticsearch 0.17.6. The version 0.18.3 and above supports logging of slow search operations, which can be configured with threshold of 0ms to log all search requests for all shards. In the version 0.19.12 this functionality was expanded to index queries as well.
If you are interested in logging all HTTP requests, the elasticsearch-jetty plugin supports this functionality for elasticsearch 0.18.4 and above.
Upvotes: 13