I am using python-elasticsearch module, I read in the python-elasticsearch documentation that you can log all the underlying HTTP requests as command line curl
commands:
elasticsearch.trace can be used to log requests to the server in the form of curl commands using pretty-printed json that can then be executed from command line. Because it is designed to be shared (for example to demonstrate an issue) it also just uses localhost:9200 as the address instead of the actual address of the host. If the trace logger has not been configured already it is set to propagate=False so it needs to be activated separately.
For python-elasticsearch module, how do you enable this curl
logging?
I tried:
- setting the global logger to
logging.basicConfig(level=logging.DEBUG)
but that didn't output the curl - I tried getting the
elasticsearch.trace
logger and setting that logger's level tologging.DEBUG
and then settinges_trace_logger.propagate = True
but neither of those worked