Bugzilla – Attachment 112712 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.55 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-10-30 15:12:06 UTC
(
hide
)
Description:
Bug 26310: Allow setting trace_to parameter in Elaasticsearch config
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-10-30 15:12:06 UTC
Size:
3.55 KB
patch
obsolete
>From f012d3e1e736861a790f32c99f08cc9b7bd07545 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> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > 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 e7a8964ba19..182551f4af6 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 eff50d2bcd8..bb28962a3a0 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 79c198c3f26..c4fe589aa36 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.29.1
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