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

(-)a/debian/templates/log4perl-site.conf.in (+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 = WARN, PLACK
16
log4perl.appender.PLACK=Log::Log4perl::Appender::File
17
log4perl.appender.PLACK.filename=__LOG_DIR__/plack-error.log
18
log4perl.appender.PLACK.mode=append
19
log4perl.appender.PLACK.layout=PatternLayout
20
log4perl.appender.PLACK.layout.ConversionPattern=[%d] [%p] %m
(-)a/debian/templates/plack.psgi (-7 / +5 lines)
Lines 36-49 use Koha::Caches; Link Here
36
use Koha::Cache::Memory::Lite;
36
use Koha::Cache::Memory::Lite;
37
use Koha::Database;
37
use Koha::Database;
38
use Koha::DateUtils;
38
use Koha::DateUtils;
39
40
#BZ 16357, add timestamps to warnings
41
use Koha::Logger;
39
use Koha::Logger;
42
40
43
my $logger = Koha::Logger->get({ interface => 'plack-error' });
44
$SIG{__WARN__} = sub { $logger->warn(shift);  };
45
$SIG{__DIE__}  = sub { $logger->fatal(shift); };
46
47
use CGI qw(-utf8 ); # we will loose -utf8 under plack, otherwise
41
use CGI qw(-utf8 ); # we will loose -utf8 under plack, otherwise
48
{
42
{
49
    no warnings 'redefine';
43
    no warnings 'redefine';
Lines 72-85 my $apiv1 = builder { Link Here
72
    $server->to_psgi_app;
66
    $server->to_psgi_app;
73
};
67
};
74
68
69
Koha::Logger->get;
70
75
builder {
71
builder {
76
    enable "ReverseProxy";
72
    enable "ReverseProxy";
77
    enable "Plack::Middleware::Static";
73
    enable "Plack::Middleware::Static";
74
    enable "Log4perl", category => "plack";
75
    enable "LogErrors";
76
    enable "LogWarn";
78
    # + is required so Plack doesn't try to prefix Plack::Middleware::
77
    # + is required so Plack doesn't try to prefix Plack::Middleware::
79
    enable "+Koha::Middleware::SetEnv";
78
    enable "+Koha::Middleware::SetEnv";
80
79
81
    mount '/opac'          => $opac;
80
    mount '/opac'          => $opac;
82
    mount '/intranet'      => $intranet;
81
    mount '/intranet'      => $intranet;
83
    mount '/api/v1/app.pl' => $apiv1;
82
    mount '/api/v1/app.pl' => $apiv1;
84
85
};
83
};
(-)a/etc/log4perl.conf (-7 / +6 lines)
Lines 12-20 log4perl.appender.OPAC.mode=append Link Here
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
14
15
log4perl.logger.plack-error = WARN, PLACK-ERROR
15
log4perl.logger.plack = WARN, PLACK
16
log4perl.appender.PLACK-ERROR=Log::Log4perl::Appender::File
16
log4perl.appender.PLACK=Log::Log4perl::Appender::File
17
log4perl.appender.PLACK-ERROR.filename=__LOG_DIR__/plack-error.log
17
log4perl.appender.PLACK.filename=__LOG_DIR__/plack-error.log
18
log4perl.appender.PLACK-ERROR.mode=append
18
log4perl.appender.PLACK.mode=append
19
log4perl.appender.PLACK-ERROR.layout=PatternLayout
19
log4perl.appender.PLACK.layout=PatternLayout
20
log4perl.appender.PLACK-ERROR.layout.ConversionPattern=[%d] [%p] %m
20
log4perl.appender.PLACK.layout.ConversionPattern=[%d] [%p] %m
21
- 

Return to bug 16357