Bugzilla – Attachment 99180 Details for
Bug 24071
Ask for complete information when opening a bug report
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24071: Add a way to export debug info
Bug-24071-Add-a-way-to-export-debug-info.patch (text/plain), 9.81 KB, created by
Jonathan Druart
on 2020-02-18 12:30:36 UTC
(
hide
)
Description:
Bug 24071: Add a way to export debug info
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-02-18 12:30:36 UTC
Size:
9.81 KB
patch
obsolete
>From f76e1350b27134dd2ac4c785d522dc9e49a38697 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 18 Feb 2020 13:22:35 +0100 >Subject: [PATCH] Bug 24071: Add a way to export debug info > >Actually this patch does much more, but still not enough. >There are 2 goals that I would like to achieve with this patch: > * Add an entry point to the Koha wiki from Koha > * Explain a bit how to report a from within Koha, and export useful > data > >TODO: > * Stylish > * Fix wording > * Improve exported file (must be either a .txt or .zip with other text > files, not a .pdf) > * Display other log files, not only plack-error.log > * Display the bottom of the log file, not the beginning > * Only display the last X lines of the logs (500?) > * Is there a way to retrieve the content of the JS console (sounds > impossible to get it from other tabs anyway, unless we copy it in > the local storage, which seems wrong). > > * Main question: how critical it is to display the log file? Is that ok to > display it for superlibrarian only? > They will need to be warned that the file could contain potential > data they do not want to share publicly (IP, DB name, etc.). >--- > about.pl | 8 ++ > koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 110 +++++++++++++++++++++++ > 2 files changed, 118 insertions(+) > >diff --git a/about.pl b/about.pl >index 184e9375db..17dca46b8b 100755 >--- a/about.pl >+++ b/about.pl >@@ -25,6 +25,7 @@ use Modern::Perl; > use CGI qw ( -utf8 ); > use DateTime::TimeZone; > use File::Spec; >+use File::Slurp qw( read_file ); > use List::MoreUtils qw/ any /; > use LWP::Simple; > use Module::Load::Conditional qw(can_load); >@@ -702,4 +703,11 @@ if ( open( my $file, "<:encoding(UTF-8)", "$docdir" . "/history.txt" ) ) { > $template->param( timeline_read_error => 1 ); > } > >+my $logdir = C4::Context->config('logdir'); >+my $plack_error_log = read_file("$logdir/plack-error.log"); >+# TODO could add SIP, indexer, Zebra >+$template->param( >+ plack_error_log => $plack_error_log, >+); >+ > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >index 61927acbbc..c6b0c4e32b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >@@ -28,6 +28,7 @@ > <li><a href="#licenses">Licenses</a></li> > <li><a href="#translations">Translations</a></li> > <li><a href="#history">Timeline</a></li> >+ <li><a href="#get_in_touch">The Koha community</a></li> > </ul> > > <div id="about"> >@@ -796,14 +797,123 @@ > [% END %] > </div> > >+ >+ >+ <div id="get_in_touch"> >+ <h2>Get in touch with the Koha community</h2> >+ <p>There are several ways to get in touch with the Koha community.</p> >+ <p>Most of them are listed on the <a href="https://wiki.koha-community.org/wiki/Getting_involved">Getting involved page of the wiki</a>. >+ You will learn how to improve the manual, become a translator, open a bug report, test bugs, and even write your own patches!</p> >+ >+ <h2>Open a new bug report</h2> >+ <p>We would like to give you some hints about how to open a new bug report on our bug trackers.</p> >+ <p>Before opening a bug report you need to make sure that this is a real bug. >+ You also need to ask your support provider, if you have one, to confirm the bug for you.</p> >+ <p>What would be the different steps before opening a new bug report?</p> >+ <p>You should first make sure it is not fixed yet or it is not a configuration issue. To do so you should try and recreate the bug on <a href="https://wiki.koha-community.org/wiki/Sandboxes">one of the sandboxes provided by the community</a>.</p> >+ <p>If you recreate it on the sandbox you can note the different steps and describe them on the bug report you are going to open.</p> >+ <p>It is also important to provide the different information:</p> >+ <div id="debug_info"> >+ <table> >+ <tr><th scope="row">Koha version: </th><td>[% kohaVersion | html %]</td></tr> >+ <tr><th scope="row">OS version ('uname -a'): </th><td>[% osVersion | html %]</td></tr> >+ <tr><th scope="row">Perl interpreter: </th><td>[% perlPath | html %]</td></tr> >+ <tr><th scope="row">Perl version: </th><td>[% perlVersion | html %]</td></tr> >+ <tr><th scope="row">MySQL version: </th><td>[% mysqlVersion | html %]</td></tr> >+ [% IF (is_psgi) %] >+ <tr><th scope="row">PSGI: </th><td>[% psgi_server | html %]</td></tr> >+ [% END %] >+ [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %] >+ <tr> >+ <th scope="row">Elasticsearch: </th> >+ [% IF elasticsearch_fatal_config_error %] >+ <td><span class="status_warn">[% elasticsearch_fatal_config_error | html %]</span></td> >+ [% ELSE %] >+ <td> >+ Nodes: >+ <span>[% elasticsearch_status.nodes.join(' / ') | html %]</span> >+ | >+ Status: >+ [% IF elasticsearch_status.running %] >+ <span class="status_ok">running</span> >+ | >+ Indices: >+ [% FOREACH index IN elasticsearch_status.indexes %] >+ [% index.index_name | html %] (count: <emph>[% index.count | html %]</emph>)[% UNLESS loop.last %], [% END %] >+ [% END %] >+ [% ELSE %] >+ <span class="status_warn">not running</span> >+ [% END %] >+ </td> >+ [% END %] >+ </tr> >+ [% END %] >+ <tr><th scope="row">Memcached: </th> >+ <td> >+ Servers: [% IF memcached_servers %]<span>[% memcached_servers | html %]</span> >+ [% ELSE %]<span>undefined</span>[% END %] | >+ Namespace: [% IF memcached_namespace %]<span>[% memcached_namespace | html %]</span> >+ [% ELSE %]<span>undefined</span>[% END %] | >+ Status: [% IF memcached_servers %] >+ [% IF memcached_running and is_memcached_still_active %] >+ <span class="status_ok">running</span>. >+ [% ELSE %] >+ <span class="status_warn">not running</span>. >+ [% IF is_psgi %] >+ <span>Remember memcached needs to be started before Plack.</span> >+ [% END %] >+ [% END %] >+ [% ELSE %] >+ <span>unknown</span> >+ [% END %] | >+ Config read from: >+ [% SWITCH where_is_memcached_config %] >+ [% CASE 'config_only' %] >+ <span class="status_ok">koha-conf.xml</span> >+ [% CASE 'ENV_only' %] >+ <span class="status_warn">ENV</span> Note that the right place to define the memcached config is in your $KOHA_CONF file >+ [% CASE 'both' %] >+ <span class="status_warn">ENV and koha-conf.xml</span> Note that the right place to define the memcached config is in your $KOHA_CONF file. To avoid any misunderstanding you should not export the memcached config from ENV. >+ [% CASE # nowhere %] >+ <span class="status_warn">Nowhere</span> Note that the right place to define the memcached config is in your $KOHA_CONF file. Currently you do not have a valid memcached configuration defined. >+ [% END %] >+ [% IF effective_caching_method != 'Cache::Memcached::Fast::Safe' %] >+ | Effective caching method: [% effective_caching_method | html %] >+ [% END %] >+ </td> >+ </tr> >+ <tr><th scope="row">Zebra version: </th><td>[% zebraVersion | html %]</td></tr> >+ [% IF (errZebraConnection == 10000) %] >+ <tr><th scope="row"><b>Error</b> </th><td>Zebra server seems not to be available. Is it started?</td></tr> >+ [% ELSIF (errZebraConnection) %] >+ <tr><th scope="row"><b>Warning</b> </th><td>Error message from Zebra: [% ( errZebraConnection ) | html %] </td></tr> >+ [% END %] >+ </table> >+ >+ <ol> >+ <li> >+ Plack error log: <textarea cols="100" rows="25">[% plack_error_log | html_line_break %]</textarea> >+ </li> >+ </ol> >+ </div> >+ <button id="print_debug" class="btn btn-default">Export</button> >+ </div> > </div> > </div> > </div> > > [% MACRO jsinclude BLOCK %] > <script type="text/javascript"> >+ function print_debug(){ >+ var debug_content = $("#debug_info").html(); >+ var original_content = document.body.innerHTML >+ document.body.innerHTML = debug_content; >+ window.print(); >+ document.body.innerHTML = original_content; >+ } > $(document).ready(function() { > $('#abouttabs').tabs(); >+ $("#print_debug").on("click", function(){print_debug()}); > }); > </script> > [% END %] >-- >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 24071
: 99180