# Logging in an ElasticSearch plugin

**URL:** <https://discuss.elastic.co/t/logging-in-an-elasticsearch-plugin/261097>\
**Category:** Elasticsearch\
**Created:** [January 14, 2021, 9:28am UTC](https://discuss.elastic.co/t/logging-in-an-elasticsearch-plugin/261097 "2021-01-14T09:28:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![coreation](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/coreation/32/10165_2.png) [@coreation](https://discuss.elastic.co/u/coreation)\
**Post date:** [January 14, 2021, 9:28am UTC](https://discuss.elastic.co/t/logging-in-an-elasticsearch-plugin/261097/1 "2021-01-14T09:28:18Z")

</div>

Hello everyone,

I'm working on a simple ElasticSearch plugin that computes a score for a document. What I would love to do is to be able to debug the plugin so that I can write to the standard output which document is being handled by the plugin, so that I can see for document X -\> score Y has been computed.

I have a LeafReaderContext at my disposal in the plugin, but so far I haven't been able to find any documentation that provides me on how to read the "id" from the document so far, which I could use to log interesting info. In an ElasticSearch plugin you also have the "int docId" at your disposal but that's an internal ID, not one that is exposed in a way you can use it to identify the document.

Any help towards being able to output the document ID in an ElasticSearch plugin, or a way to help debug is very much appreciated!

Have a good one!

---

<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:** [February 11, 2021, 9:28am UTC](https://discuss.elastic.co/t/logging-in-an-elasticsearch-plugin/261097/2 "2021-02-11T09:28:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
