# ElasticSearch Java TransportClient Logging Requests (logback)?

**URL:** <https://discuss.elastic.co/t/elasticsearch-java-transportclient-logging-requests-logback/61494>\
**Category:** Elasticsearch\
**Created:** [September 26, 2016, 8:45am UTC](https://discuss.elastic.co/t/elasticsearch-java-transportclient-logging-requests-logback/61494 "2016-09-26T08:45:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![schmitch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/schmitch/32/12142_2.png) [@schmitch](https://discuss.elastic.co/u/schmitch)\
**Post date:** [September 26, 2016, 8:45am UTC](https://discuss.elastic.co/t/elasticsearch-java-transportclient-logging-requests-logback/61494/1 "2016-09-26T08:45:04Z")

</div>

Hello, is there a way to log all the Requests of Elasticsearch?  
I mean if I have a simple Query:  
v.prepareSearch()  
.setTypes("customer")  
.setQuery(QueryBuilders.termQuery("name", name))

Is there a way to get the Json output of that?  
We are using logback so if there is a way to have a info logger, it would be great. Else it would be ok to get the Json with code, however if there is a built in way it would be great.

---

<div class="post-metadata">

**Author:** ![Douglas\_Smith](https://avatars.discourse-cdn.com/v4/letter/d/d78d45/32.png) [@Douglas\_Smith](https://discuss.elastic.co/u/Douglas_Smith)\
**Post date:** [January 27, 2017, 5:56pm UTC](https://discuss.elastic.co/t/elasticsearch-java-transportclient-logging-requests-logback/61494/2 "2017-01-27T17:56:35Z")

</div>

Here is how I do it:

```
SearchRequestBuilder searchRequest = esClientService.getTransportClient().prepareSearch(indexName)
... more code ...
log.debug searchRequest.inspect()

```

This returns the JSON query, generated by the Java API

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:03pm UTC](https://discuss.elastic.co/t/elasticsearch-java-transportclient-logging-requests-logback/61494/3 "2017-07-05T22:03:48Z")

</div>


