[Koha-bugs] [Bug 16357] Plack error logs are not time stamped

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Mar 15 02:27:04 CET 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357

--- Comment #16 from M. Tompsett <mtompset at hotmail.com> ---
Comment on attachment 72296
  --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=72296
Bug 16357: (follow-up) Log and timestamp fatal errors

Review of attachment 72296:
 --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=16357&attachment=72296)
-----------------------------------------------------------------

::: debian/templates/plack.psgi
@@ +41,5 @@
>  use Log::Log4perl qw(:easy);
>  Log::Log4perl->easy_init({ level => $WARN, utf8 => 1 });
>  my $logger = Log::Log4perl->get_logger(); # use the default logger style
> +$SIG{__WARN__} = sub { $logger->warn(shift) };
> +$SIG{__DIE__}  = sub { $logger->fatal(shift) };

I prefer using my ($message) = @_; because I believe it is less floody prone,
though I could be wrong. And while I value vertical space too, I would have
left the __WARN__ code unchanged, and mirrored that layout for __DIE__.

::: misc/plack/koha.psgi
@@ +9,5 @@
>  use Log::Log4perl qw(:easy);
>  Log::Log4perl->easy_init({ level => $WARN, utf8 => 1 });
>  my $logger = Log::Log4perl->get_logger(); # use the default logger style
> +$SIG{__WARN__} = sub { $logger->warn(shift) };
> +$SIG{__DIE__}  = sub { $logger->fatal(shift) };

If bug 20393 is valid, this change is unnecessary.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list