At the moment, Zebra logs using a dateformat of "hh:mm:ss-DD/MM". For example, "23:16:22-21/12". I propose that we change it to use the dateformat of "%F %T" or "%FT%T". For example, "2020-12-21 23:16:41" or "2020-12-21T23:21:19" It can be done by adding the following option to zebrasrv: -m "%F %T" or -m "%FT%T" While this option doesn't obviously appear in "man zebrasrv", it does appear in "man yaz-ztest" and the manpage for zebrasrv says that zebrasrv has the same options as "yaz-ztest".
One of the reasons for changing the dateformat is to improve log file monitoring of Zebra.
Created attachment 114581 [details] [review] Bug 27291: Reformat Zebra output logs This patch changes the Zebra output log time format from the default "hh:mm:ss-DD/MM" to the more standard ISO 8601 "%FT%T". This change makes the logs easier to read for both humans and machines. One benefit includes easy searching and sorting. Test plan: 1. cp debian/scripts/koha-zebra /usr/sbin/koha-zebra 2. koha-zebra --stop kohadev 3. koha-zebra --start kohadev 4. ps -efww | grep "zebrasrv" 5. Note "-m %FT%T" in the grep output 6. tail -f /var/log/koha/kohadev/zebra-output.log 7. Run a few searches like http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=ccl%3Dargawarga%3D1 or http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=e 8. Note that the timestamp in the Zebra log is formatted "2020-12-22T00:13:42" instead of like "00:13:42-22/12"
Actually going to switch the component from "Searching - Zebra" to "Packaging" as that might be more accurate...
Does this require that the Zebra log be enabled somehow? zebra-output.log is empty.
(In reply to Owen Leonard from comment #4) > Does this require that the Zebra log be enabled somehow? zebra-output.log is > empty. Ah possibly! If you update the koha-conf.xml with the following: <zebra_loglevels>none,fatal,warn,request</zebra_loglevels> Then restart memcached and plack, then you should get some output.
I applied the patch, updated my koha-conf, and restarted everything. I still see timestamps like this: 20:57:34-08/11 Quite possible I am doing something wrong.
(In reply to Lucas Gass from comment #6) > I applied the patch, updated my koha-conf, and restarted everything. I still > see timestamps like this: > > > 20:57:34-08/11 > > > Quite possible I am doing something wrong. That's interesting. I applied the patch, updated my koha-conf.xml, and otherwise followed the test plan, and I'm seeing this: 2023-11-08T23:14:52 zebrasrv(1) [request] Auth idPass kohauser - 2023-11-08T23:14:52 zebrasrv(1) [request] Init OK - ID:81 Name:ZOOM-C/YAZ Version:5.30.3 2af59bc45cf4508d5c84f350ee99804c4354b3b3 2023-11-08T23:14:52 zebrasrv(1) [request] Search biblios OK 393 1 1+0 RPN @attrset Bib-1 @attr 1=1016 @attr 4=6 @attr 5=1 @attr 2=102 e 2023-11-08T23:14:52 zebrasrv(1) [request] Present OK - 1 1+1
Revised Test plan: 0. vi /etc/koha/sites/kohadev/koha-conf.xml Update zebra_loglevels to the following: <zebra_loglevels>none,fatal,warn,request</zebra_loglevels> 1. cp debian/scripts/koha-zebra /usr/sbin/koha-zebra 2. koha-zebra --stop kohadev 3. koha-zebra --start kohadev 4. ps -efww | grep "zebrasrv" 5. Note "-m %FT%T" in the grep output 6. tail -f /var/log/koha/kohadev/zebra-output.log 7. Run a few searches like http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=ccl%3Dargawarga%3D1 or http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=e 8. Note that the timestamp in the Zebra log is formatted "2020-12-22T00:13:42" instead of like "00:13:42-22/12"
Created attachment 160389 [details] [review] Bug 27291: Reformat Zebra output logs This patch changes the Zebra output log time format from the default "hh:mm:ss-DD/MM" to the more standard ISO 8601 "%FT%T". This change makes the logs easier to read for both humans and machines. One benefit includes easy searching and sorting. Test plan: 1. cp debian/scripts/koha-zebra /usr/sbin/koha-zebra 2. koha-zebra --stop kohadev 3. koha-zebra --start kohadev 4. ps -efww | grep "zebrasrv" 5. Note "-m %FT%T" in the grep output 6. tail -f /var/log/koha/kohadev/zebra-output.log 7. Run a few searches like http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=ccl%3Dargawarga%3D1 or http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=e 8. Note that the timestamp in the Zebra log is formatted "2020-12-22T00:13:42" instead of like "00:13:42-22/12" Signed-off-by: David Nind <david@davidnind.com>
Testing notes (using KTD): 1. Note the amended test plan in comment #8 (particularly to change the log level) 2. Koha package commands: use sudo in front or access shell as ktd --root --shell
Created attachment 160919 [details] [review] Bug 27291: Reformat Zebra output logs This patch changes the Zebra output log time format from the default "hh:mm:ss-DD/MM" to the more standard ISO 8601 "%FT%T". This change makes the logs easier to read for both humans and machines. One benefit includes easy searching and sorting. Test plan: 1. cp debian/scripts/koha-zebra /usr/sbin/koha-zebra 2. koha-zebra --stop kohadev 3. koha-zebra --start kohadev 4. ps -efww | grep "zebrasrv" 5. Note "-m %FT%T" in the grep output 6. tail -f /var/log/koha/kohadev/zebra-output.log 7. Run a few searches like http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=ccl%3Dargawarga%3D1 or http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=e 8. Note that the timestamp in the Zebra log is formatted "2020-12-22T00:13:42" instead of like "00:13:42-22/12" Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed for 24.05! Well done everyone, thank you!
Not backported to 23.11.x
I'd marked this one as Packaging as it only affects packaged Koha, but all good
(In reply to David Cook from comment #14) > I'd marked this one as Packaging as it only affects packaged Koha, but all > good Hm, can you explain why that is? Why does the loggging for tarball Koha differ?
(In reply to Katrin Fischer from comment #15) > (In reply to David Cook from comment #14) > > I'd marked this one as Packaging as it only affects packaged Koha, but all > > good > > Hm, can you explain why that is? Why does the loggging for tarball Koha > differ? When you install Koha from a tarball, you have to set up your own Zebra service and the logging format is based off a command line parameter. I suppose we could also update ./misc/bin/koha-zebra-ctl.sh although we haven't in the past when we added the "-k $max_record_size" parameter.
Thx for the explanation, been a while since I did a tarball one :)
(In reply to Katrin Fischer from comment #17) > Thx for the explanation, been a while since I did a tarball one :) Me too! Other than for testing the build process hehe. I do love packages :3
I don't see anything that needs to be added or edited in the end user manual.