Bugzilla – Attachment 112528 Details for
Bug 26310
Allow setting trace_to parameter in Elasticsearch config
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26310: Allow setting trace_to parameter in Elaasticsearch config
Bug-26310-Allow-setting-traceto-parameter-in-Elaas.patch (text/plain), 3.49 KB, created by
Andrew Fuerste-Henry
on 2020-10-26 18:19:46 UTC
(
hide
)
Description:
Bug 26310: Allow setting trace_to parameter in Elaasticsearch config
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2020-10-26 18:19:46 UTC
Size:
3.49 KB
patch
obsolete
>From a86c08c6a2a3ee916eb9b7afc73fd33e01273d68 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 27 Aug 2020 15:24:58 +0000 >Subject: [PATCH] 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> >--- > Koha/SearchEngine/Elasticsearch.pm | 2 ++ > etc/koha-conf.xml | 2 ++ > t/db_dependent/Koha/SearchEngine/Elasticsearch.t | 7 ++++++- > 3 files changed, 10 insertions(+), 1 deletion(-) > >diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm >index e7a8964ba1..182551f4af 100644 >--- a/Koha/SearchEngine/Elasticsearch.pm >+++ b/Koha/SearchEngine/Elasticsearch.pm >@@ -1282,6 +1282,8 @@ sub _read_configuration { > > $configuration->{cxn_pool} = $conf->{cxn_pool} // 'Static'; > >+ $configuration->{trace_to} = $conf->{trace_to} if defined $conf->{trace_to}; >+ > return $configuration; > } > >diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml >index eff50d2bcd..bb28962a3a 100644 >--- a/etc/koha-conf.xml >+++ b/etc/koha-conf.xml >@@ -178,6 +178,8 @@ __PAZPAR2_TOGGLE_XML_POST__ > > <!-- See https://metacpan.org/pod/Search::Elasticsearch#cxn_pool --> > <cxn_pool>Static</cxn_pool> >+ <!-- See https://metacpan.org/pod/Search::Elasticsearch#trace_to --> >+ <!-- <trace_to>Stderr</trace_to> --> > </elasticsearch> > <!-- Uncomment the following line if you want to override the Elasticsearch default index settings --> > <!-- <elasticsearch_index_config>__KOHA_CONF_DIR__/searchengine/elasticsearch/index_config.yaml</elasticsearch_index_config> --> >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >index 79c198c3f2..c4fe589aa3 100755 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >@@ -37,7 +37,7 @@ $schema->storage->txn_begin; > > subtest '_read_configuration() tests' => sub { > >- plan tests => 13; >+ plan tests => 15; > > my $configuration; > t::lib::Mocks::mock_config( 'elasticsearch', undef ); >@@ -100,10 +100,15 @@ subtest '_read_configuration() tests' => sub { > > $configuration = Koha::SearchEngine::Elasticsearch::_read_configuration; > is( $configuration->{cxn_pool}, 'Fluid', 'cxn_pool configuration parsed correctly' ); >+ isnt( defined $configuration->{trace_to}, 'trace_to is not defined if not set' ); > > my $params = Koha::SearchEngine::Elasticsearch::get_elasticsearch_params; > is_deeply( $configuration->{nodes}, \@servers , 'get_elasticsearch_params is just a wrapper for _read_configuration' ); > >+ t::lib::Mocks::mock_config( 'elasticsearch', { server => \@servers, index_name => 'index', cxn_pool => 'Fluid', trace_to => 'Stderr' } ); >+ >+ $configuration = Koha::SearchEngine::Elasticsearch::_read_configuration; >+ is( $configuration->{trace_to}, 'Stderr', 'trace_to configuration parsed correctly' ); > }; > > subtest 'get_elasticsearch_settings() tests' => sub { >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26310
:
109240
|
112528
|
112712
|
112713