View | Details | Raw Unified | Return to bug 16357
Collapse All | Expand All

(-)a/debian/templates/plack.psgi (-7 / +5 lines)
Lines 38-50 use Koha::Database; Link Here
38
use Koha::DateUtils;
38
use Koha::DateUtils;
39
39
40
#BZ 16357, add timestamps to warnings
40
#BZ 16357, add timestamps to warnings
41
use Log::Log4perl qw(:easy);
41
use Koha::Logger;
42
Log::Log4perl->easy_init({ level => $WARN, utf8 => 1 });
42
43
my $logger = Log::Log4perl->get_logger(); # use the default logger style
43
my $logger = Koha::Logger->get({ interface => 'plack-error' });
44
$SIG{__WARN__} = sub {
44
$SIG{__WARN__} = sub { $logger->warn(shift);  };
45
    my $message = shift;
45
$SIG{__DIE__}  = sub { $logger->fatal(shift); };
46
    $logger->warn($message);
47
};
48
46
49
use CGI qw(-utf8 ); # we will loose -utf8 under plack, otherwise
47
use CGI qw(-utf8 ); # we will loose -utf8 under plack, otherwise
50
{
48
{
(-)a/etc/log4perl.conf (+7 lines)
Lines 11-13 log4perl.appender.OPAC.filename=__LOG_DIR__/opac-error.log Link Here
11
log4perl.appender.OPAC.mode=append
11
log4perl.appender.OPAC.mode=append
12
log4perl.appender.OPAC.layout=PatternLayout
12
log4perl.appender.OPAC.layout=PatternLayout
13
log4perl.appender.OPAC.layout.ConversionPattern=[%d] [%p] %m %l %n
13
log4perl.appender.OPAC.layout.ConversionPattern=[%d] [%p] %m %l %n
14
15
log4perl.logger.plack-error = WARN, PLACK-ERROR
16
log4perl.appender.PLACK-ERROR=Log::Log4perl::Appender::File
17
log4perl.appender.PLACK-ERROR.filename=__LOG_DIR__/plack-error.log
18
log4perl.appender.PLACK-ERROR.mode=append
19
log4perl.appender.PLACK-ERROR.layout=PatternLayout
20
log4perl.appender.PLACK-ERROR.layout.ConversionPattern=[%d] [%p] %m
(-)a/misc/plack/koha.psgi (-8 / +5 lines)
Lines 6-18 use Plack::Middleware::Debug; Link Here
6
use Plack::App::Directory;
6
use Plack::App::Directory;
7
7
8
#BZ 16357, add timestamps to warnings
8
#BZ 16357, add timestamps to warnings
9
use Log::Log4perl qw(:easy);
9
use Koha::Logger;
10
Log::Log4perl->easy_init({ level => $WARN, utf8 => 1 });
10
11
my $logger = Log::Log4perl->get_logger(); # use the default logger style
11
my $logger = Koha::Logger->get({ interface => 'plack-error' });
12
$SIG{__WARN__} = sub {
12
$SIG{__WARN__} = sub { $logger->warn(shift);  };
13
    my $message = shift;
13
$SIG{__DIE__}  = sub { $logger->fatal(shift); };
14
    $logger->warn($message);
15
};
16
14
17
use CGI qw(-utf8 ); # we will lose -utf8 under plack
15
use CGI qw(-utf8 ); # we will lose -utf8 under plack
18
{
16
{
19
- 

Return to bug 16357