@@ -, +, @@ about page --- about.pl | 20 +++++++++++++++++++ .../intranet-tmpl/prog/en/modules/about.tt | 15 +++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) --- a/about.pl +++ a/about.pl @@ -25,6 +25,7 @@ use Modern::Perl; 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); @@ -48,6 +49,7 @@ use Koha::Caches; use Koha::Config::SysPrefs; use Koha::Illrequest::Config; use Koha::SearchEngine::Elasticsearch; +use Koha::Logger; use C4::Members::Statistics; @@ -93,6 +95,24 @@ my $time_zone = { 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' }) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -184,7 +184,7 @@
- [% 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) %]

Warning regarding current user

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.

@@ -246,6 +246,19 @@ [% END %] [% END %] + [% IF log4perl_errors %] +

Logging system does not behave correctly

+ [% 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 %]

Warnings regarding the system configuration

--