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

(-)a/Koha/Logger.pm (-8 / +21 lines)
Lines 40-57 use C4::Context; Link Here
40
BEGIN {
40
BEGIN {
41
    Log::Log4perl->wrapper_register(__PACKAGE__);
41
    Log::Log4perl->wrapper_register(__PACKAGE__);
42
42
43
    my $conf;
44
    if ( exists $ENV{"LOG4PERL_CONF"} and $ENV{'LOG4PERL_CONF'} and -s $ENV{"LOG4PERL_CONF"} ) {
43
    if ( exists $ENV{"LOG4PERL_CONF"} and $ENV{'LOG4PERL_CONF'} and -s $ENV{"LOG4PERL_CONF"} ) {
45
46
        # Check for web server level configuration first
44
        # Check for web server level configuration first
47
        $conf = $ENV{"LOG4PERL_CONF"};
45
        Log::Log4perl->init_once( $ENV{"LOG4PERL_CONF"} );
48
    }
46
    }
49
    else {
47
    elsif ( C4::Context->config("log4perl_conf") ) {
50
        # If no web server level config exists, look in the koha conf file for one
48
        # If no web server level config exists, look in the koha conf file for one
51
        $conf = C4::Context->config("log4perl_conf");
49
        Log::Log4perl->init_once( C4::Context->config("log4perl_conf") );
50
    } else {
51
        my $logdir = C4::Context->config("logdir");
52
        my $conf = qq(
53
            log4perl.logger.intranet = WARN, INTRANET
54
            log4perl.appender.INTRANET=Log::Log4perl::Appender::File
55
            log4perl.appender.INTRANET.filename=$logdir/intranet-error.log
56
            log4perl.appender.INTRANET.mode=append
57
            log4perl.appender.INTRANET.layout=PatternLayout
58
            log4perl.appender.INTRANET.layout.ConversionPattern=[%d] [%p] %m %l %n
59
60
            log4perl.logger.opac = WARN, OPAC
61
            log4perl.appender.OPAC=Log::Log4perl::Appender::File
62
            log4perl.appender.OPAC.filename=$logdir/opac-error.log
63
            log4perl.appender.OPAC.mode=append
64
            log4perl.appender.OPAC.layout=PatternLayout
65
            log4perl.appender.OPAC.layout.ConversionPattern=[%d] [%p] %m %l %n
66
        );
67
        Log::Log4perl->init_once(\$conf);
52
    }
68
    }
53
54
    Log::Log4perl->init_once($conf);
55
}
69
}
56
70
57
=head2 get
71
=head2 get
58
- 

Return to bug 14167