Bug 26310

Summary: Allow setting trace_to parameter in Elasticsearch config
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: Searching - ElasticsearchAssignee: Nick Clemens (kidclamp) <nick>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi <tomascohen>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
By setting the 'trace_to' parameter in the elasticsearch config we can log the requests sent to the ES cluster to aid in debugging search or indexing issues
Version(s) released in:
20.11.00
Attachments: Bug 26310: Allow setting trace_to parameter in Elaasticsearch config
Bug 26310: Allow setting trace_to parameter in Elaasticsearch config
Bug 26310: Allow setting trace_to parameter in Elaasticsearch config
Bug 26310: (QA follow-up) koha-conf-site.xml.in tweaks

Description Nick Clemens (kidclamp) 2020-08-27 15:07:52 UTC
When debugging it would be nice to see the requests/responses from Elasticsearch

We can set a debug variable:
https://metacpan.org/pod/Search::Elasticsearch#trace_to
Comment 1 Nick Clemens (kidclamp) 2020-08-27 15:31:50 UTC
Created attachment 109240 [details] [review]
Bug 26310: Allow setting trace_to parameter in Elaasticsearch config

For debugging purposes we may wish to see the requests and responses made to
Elasticsearch

To test:
1 - prove -v t/Koha/SearchEngine/Elasticsearch.t
2 - Set <trace_to>Stderr</trace_to> in koha-conf
3 - Restart all
4 - perl misc/search_tools/rebuild_elasticsearch.pl
5 - Note requests are shown
6 - Set
    <trace_to>File</trace_to>
    <trace_to>/var/log/koha/kohadev/plack-error.log</trace_to>
    in koha-conf
7 - Restart all
8 - perl misc/search_tools/rebuild_elasticsearch.pl
9 - Check the plack log and see the ES requests
Comment 2 Andrew Fuerste-Henry 2020-10-26 18:19:46 UTC
Created attachment 112528 [details] [review]
Bug 26310: Allow setting trace_to parameter in Elaasticsearch config

For debugging purposes we may wish to see the requests and responses made to
Elasticsearch

To test:
1 - prove -v t/Koha/SearchEngine/Elasticsearch.t
2 - Set <trace_to>Stderr</trace_to> in koha-conf
3 - Restart all
4 - perl misc/search_tools/rebuild_elasticsearch.pl
5 - Note requests are shown
6 - Set
    <trace_to>File</trace_to>
    <trace_to>/var/log/koha/kohadev/plack-error.log</trace_to>
    in koha-conf
7 - Restart all
8 - perl misc/search_tools/rebuild_elasticsearch.pl
9 - Check the plack log and see the ES requests

Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Comment 3 Tomás Cohen Arazi 2020-10-30 15:12:06 UTC
Created attachment 112712 [details] [review]
Bug 26310: Allow setting trace_to parameter in Elaasticsearch config

For debugging purposes we may wish to see the requests and responses made to
Elasticsearch

To test:
1 - prove -v t/Koha/SearchEngine/Elasticsearch.t
2 - Set <trace_to>Stderr</trace_to> in koha-conf
3 - Restart all
4 - perl misc/search_tools/rebuild_elasticsearch.pl
5 - Note requests are shown
6 - Set
    <trace_to>File</trace_to>
    <trace_to>/var/log/koha/kohadev/plack-error.log</trace_to>
    in koha-conf
7 - Restart all
8 - perl misc/search_tools/rebuild_elasticsearch.pl
9 - Check the plack log and see the ES requests

Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Tomás Cohen Arazi 2020-10-30 15:12:10 UTC
Created attachment 112713 [details] [review]
Bug 26310: (QA follow-up) koha-conf-site.xml.in tweaks

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Jonathan Druart 2020-11-04 12:03:42 UTC
Pushed to master for 20.11, thanks to everybody involved!