use CGI qw ( -utf8 );
use DateTime::TimeZone;
use File::Spec;
+use File::Slurp;
use List::MoreUtils qw/ any /;
use LWP::Simple;
use Module::Load::Conditional qw(can_load);
use Koha::Config::SysPrefs;
use Koha::Illrequest::Config;
use Koha::SearchEngine::Elasticsearch;
+use Koha::Logger;
use C4::Members::Statistics;
environment_invalid => $env_invalid
};
+{ # Logger checks
+ my $log4perl_config = C4::Context->config("log4perl_conf");
+ my @log4perl_errors;
+ if ( ! $log4perl_config ) {
+ push @log4perl_errors, 'missing_config_entry'
+ }
+ else {
+ my @lines = read_file($log4perl_config) or push @log4perl_errors, 'cannot_read_config_file';
+ for my $line ( @lines ) {
+ next unless $line =~ m|log4perl.appender.\w+.filename=(.*)|;
+ push @log4perl_errors, 'logfile_not_writable' unless -w $1;
+ }
+ }
+ eval {Koha::Logger->get};
+ push @log4perl_errors, 'cannot_init_module' and warn $@ if $@;
+ $template->param( log4perl_errors => @log4perl_errors );
+}
+
$template->param(
time_zone => $time_zone,
current_date_and_time => output_pref({ dt => dt_from_string(), dateformat => 'iso' })
</div>
<div id="sysinfo">
- [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships %]
+ [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors %]
[% IF (warnIsRootUser) %]
<h2>Warning regarding current user</h2>
<p>You are logged in as the database administrative user. This is not recommended because some parts of Koha will not function as expected when using this account.</p>
[% END %]
[% END %]
+ [% IF log4perl_errors %]
+ <h2>Logging system does not behave correctly</h2>
+ [% FOR e IN log4perl_errors %]
+ [% SWITCH e %]
+ [% CASE 'missing_config_entry' %]There is no 'log4perl_conf' entry in the config file.
+ [% CASE 'cannot_read_config_file' %]The log4perl config file cannot be opened.
+ [% CASE 'logfile_not_writable' %]One of the logfiles listed in the config file is not writable.
+ [% CASE 'cannot_init_module' %]The Koha::Logger module cannot be initiated correctly (check the log file).
+ [% CASE %]Unknown error "[% e %]"
+ [% END %]
+ [% END %]
+ [% END %]
+
[% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules %]
<h2>Warnings regarding the system configuration</h2>
<table>