Bug 7247 - rebuild_zebra.pl -v should show all Zebra log output

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug 7247 - rebuild_zebra.pl -v should show all Zebra log output

Dobrica Pavlinusic
Currently, -v option resets Zebra log output to default system values.

This produce amount of log specified in system defaults which is usually
too low for debugging.

This change explicitly forces all Zebra log output which create much more
chatter so it triggers with verbosity level 2

Test scenario:
1. pick koha site to reindex
2. use -v -v options to rebuild_zebra.pl to see additional output
---
 misc/migration_tools/rebuild_zebra.pl |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl
index 6fa6501..5168fc4 100755
--- a/misc/migration_tools/rebuild_zebra.pl
+++ b/misc/migration_tools/rebuild_zebra.pl
@@ -34,7 +34,7 @@ my $want_help;
 my $as_xml;
 my $process_zebraqueue;
 my $do_not_clear_zebraqueue;
-my $verbose_logging;
+my $verbose_logging = 0;
 my $zebraidx_log_opt = " -v none,fatal,warn ";
 my $result = GetOptions(
     'd:s'           => \$directory,
@@ -51,7 +51,7 @@ my $result = GetOptions(
  'x' => \$as_xml,
     'y'             => \$do_not_clear_zebraqueue,
     'z'             => \$process_zebraqueue,
-    'v'             => \$verbose_logging,
+    'v+'            => \$verbose_logging,
 );
 
 
@@ -96,8 +96,8 @@ if ($noshadow) {
 
 #  -v is for verbose, which seems backwards here because of how logging is set
 #    on the CLI of zebraidx.  It works this way.  The default is to not log much
-if ($verbose_logging) {
-    $zebraidx_log_opt = '';
+if ($verbose_logging >= 2) {
+    $zebraidx_log_opt = '-v none,fatal,warn,all';
 }
 
 my $use_tempdir = 0;
@@ -639,6 +639,7 @@ Parameters:
 
     -v                      increase the amount of logging.  Normally only
                             warnings and errors from the indexing are shown.
+                            Use log level 2 (-v -v) to include all Zebra logs.
 
     -munge-config           Deprecated option to try
                             to fix Zebra config files.
--
1.7.2.5

_______________________________________________
Koha-patches mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

Re: Bug 7247 - rebuild_zebra.pl -v should show all Zebra log output

Henri-Damien LAURENT
Le 20/12/2011 13:05, Dobrica Pavlinusic a écrit :

> Currently, -v option resets Zebra log output to default system values.
>
> This produce amount of log specified in system defaults which is usually
> too low for debugging.
>
> This change explicitly forces all Zebra log output which create much more
> chatter so it triggers with verbosity level 2
>
> Test scenario:
> 1. pick koha site to reindex
> 2. use -v -v options to rebuild_zebra.pl to see additional output
> ---
>  misc/migration_tools/rebuild_zebra.pl |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl
> index 6fa6501..5168fc4 100755
> --- a/misc/migration_tools/rebuild_zebra.pl
> +++ b/misc/migration_tools/rebuild_zebra.pl
> @@ -34,7 +34,7 @@ my $want_help;
>  my $as_xml;
>  my $process_zebraqueue;
>  my $do_not_clear_zebraqueue;
> -my $verbose_logging;
> +my $verbose_logging = 0;
>  my $zebraidx_log_opt = " -v none,fatal,warn ";
>  my $result = GetOptions(
>      'd:s'           => \$directory,
> @@ -51,7 +51,7 @@ my $result = GetOptions(
>   'x' => \$as_xml,
>      'y'             => \$do_not_clear_zebraqueue,
>      'z'             => \$process_zebraqueue,
> -    'v'             => \$verbose_logging,
> +    'v+'            => \$verbose_logging,
>  );
>  
>  
> @@ -96,8 +96,8 @@ if ($noshadow) {
>  
>  #  -v is for verbose, which seems backwards here because of how logging is set
>  #    on the CLI of zebraidx.  It works this way.  The default is to not log much
> -if ($verbose_logging) {
> -    $zebraidx_log_opt = '';
> +if ($verbose_logging >= 2) {
> +    $zebraidx_log_opt = '-v none,fatal,warn,all';
>  }
mmm... in my opinion, all would be WAY too verbose.
request,log are enough to debug the search query.
my two cents.

>  
>  my $use_tempdir = 0;
> @@ -639,6 +639,7 @@ Parameters:
>  
>      -v                      increase the amount of logging.  Normally only
>                              warnings and errors from the indexing are shown.
> +                            Use log level 2 (-v -v) to include all Zebra logs.
>  
>      -munge-config           Deprecated option to try
>                              to fix Zebra config files.

_______________________________________________
Koha-patches mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

Re: Bug 7247 - rebuild_zebra.pl -v should show all Zebra log output

Dobrica Pavlinusic
On Tue, Dec 20, 2011 at 02:06:24PM +0100, LAURENT Henri-Damien wrote:
> > -if ($verbose_logging) {
> > -    $zebraidx_log_opt = '';
> > +if ($verbose_logging >= 2) {
> > +    $zebraidx_log_opt = '-v none,fatal,warn,all';
> >  }
> mmm... in my opinion, all would be WAY too verbose.
> request,log are enough to debug the search query.
> my two cents.

all is very verbose, but does provide additional information about Zebra
progress (I must admit I'm leaning towards too much information as
opposed to too little).

Should I move all to verbose level 3 (-v -v -v) or just remove it all
together?

--
Dobrica Pavlinusic               2share!2flame            [hidden email]
Unix addict. Internet consultant.             http://www.rot13.org/~dpavlin
_______________________________________________
Koha-patches mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

Re: Bug 7247 - rebuild_zebra.pl -v should show all Zebra log output

Henri-Damien LAURENT
Le 20/12/2011 15:52, Dobrica Pavlinusic a écrit :

> On Tue, Dec 20, 2011 at 02:06:24PM +0100, LAURENT Henri-Damien wrote:
>>> -if ($verbose_logging) {
>>> -    $zebraidx_log_opt = '';
>>> +if ($verbose_logging >= 2) {
>>> +    $zebraidx_log_opt = '-v none,fatal,warn,all';
>>>  }
>> mmm... in my opinion, all would be WAY too verbose.
>> request,log are enough to debug the search query.
>> my two cents.
>
> all is very verbose, but does provide additional information about Zebra
> progress (I must admit I'm leaning towards too much information as
> opposed to too little).
>
> Should I move all to verbose level 3 (-v -v -v) or just remove it all
> together?
>
I would leave that to -vvv
When I looked at logs when all is set, I found it quite useless, but if
you need that. I would say let's keep it for -vvv
_______________________________________________
Koha-patches mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

Re: Bug 7247 - rebuild_zebra.pl -v should show all Zebra log output

Dobrica Pavlinusic
On Tue, Dec 20, 2011 at 04:54:17PM +0100, LAURENT Henri-Damien wrote:

> Le 20/12/2011 15:52, Dobrica Pavlinusic a écrit :
> > On Tue, Dec 20, 2011 at 02:06:24PM +0100, LAURENT Henri-Damien wrote:
> >>> -if ($verbose_logging) {
> >>> -    $zebraidx_log_opt = '';
> >>> +if ($verbose_logging >= 2) {
> >>> +    $zebraidx_log_opt = '-v none,fatal,warn,all';
> >>>  }
> >> mmm... in my opinion, all would be WAY too verbose.
> >> request,log are enough to debug the search query.
> >> my two cents.
> >
> > all is very verbose, but does provide additional information about Zebra
> > progress (I must admit I'm leaning towards too much information as
> > opposed to too little).
> >
> > Should I move all to verbose level 3 (-v -v -v) or just remove it all
> > together?
> >
> I would leave that to -vvv
> When I looked at logs when all is set, I found it quite useless, but if
> you need that. I would say let's keep it for -vvv

I re-examined $zebraidx_log_opt handling with my changes, and default option
(without -v parameter or with single -v) is now "none,fatal,warn".

Only thing which is affected by -v -v is adding "all" to Zebra logs so I
think that moving it to -v -v -v isn't needed: it has same effect as -v -v
does now (and would leave -v -v doing nothing).

However, it does fixes behaviour with -v which used to reset Zebra log
options to '' and thus system defaults as opposed to leaving zebra log
flags at "none,fatal,warn".

Existing code does produce different logs without -v ("none,fatal,wran") and
with single -v (whatever is system default, which is usually just fatal),
but I think new behaviour is improvement in this regard.

Does this address your concernes with this patch?

--
Dobrica Pavlinusic               2share!2flame            [hidden email]
Unix addict. Internet consultant.             http://www.rot13.org/~dpavlin
_______________________________________________
Koha-patches mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/