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

(-)a/C4/Log.pm (+8 lines)
Lines 26-31 use warnings; Link Here
26
26
27
use C4::Context;
27
use C4::Context;
28
use C4::Dates qw(format_date);
28
use C4::Dates qw(format_date);
29
use Sys::Syslog qw(:standard :macros);
29
30
30
use vars qw($VERSION @ISA @EXPORT);
31
use vars qw($VERSION @ISA @EXPORT);
31
32
Lines 79-84 sub logaction { Link Here
79
    my $sth=$dbh->prepare("Insert into action_logs (timestamp,user,module,action,object,info) values (now(),?,?,?,?,?)");
80
    my $sth=$dbh->prepare("Insert into action_logs (timestamp,user,module,action,object,info) values (now(),?,?,?,?,?)");
80
    $sth->execute($usernumber,$modulename,$actionname,$objectnumber,$infos);
81
    $sth->execute($usernumber,$modulename,$actionname,$objectnumber,$infos);
81
    $sth->finish;
82
    $sth->finish;
83
84
    my $facility = C4::Context->config("syslog_facility") or return;
85
    my $kohasite = C4::Context->config("kohasite");
86
    openlog($kohasite, 'nofatal', $facility);
87
    $objectnumber = '' unless defined $objectnumber;
88
    syslog(LOG_NOTICE, "$modulename: $actionname ($objectnumber); [$usernumber] $infos");
89
    closelog();
82
}
90
}
83
91
84
=item GetLogStatus
92
=item GetLogStatus
(-)a/debian/scripts/koha-create (-1 / +5 lines)
Lines 546-553 eof Link Here
546
    # Generate and install Apache site-available file and log dir.
546
    # Generate and install Apache site-available file and log dir.
547
    generate_config_file apache-site.conf.in \
547
    generate_config_file apache-site.conf.in \
548
        "/etc/apache2/sites-available/$name.conf"
548
        "/etc/apache2/sites-available/$name.conf"
549
    # Generate and install rsyslog conf
550
    generate_config_file rsyslog-site.conf.in \
551
        "/etc/rsyslog.d/99-$name.conf"
549
    mkdir "/var/log/koha/$name"
552
    mkdir "/var/log/koha/$name"
550
    chown "$username:$username" "/var/log/koha/$name"
553
    chown "$username:adm" "/var/log/koha/$name"
554
    chmod 0775            "/var/log/koha/$name"
551
555
552
556
553
    # Generate and install main Koha config file.
557
    # Generate and install main Koha config file.
(-)a/debian/scripts/koha-dump (+1 lines)
Lines 63-68 tar -C / -czf "$metadump" \ Link Here
63
    "etc/koha/sites/$name" \
63
    "etc/koha/sites/$name" \
64
    "etc/apache2/sites-available/$instancefile" \
64
    "etc/apache2/sites-available/$instancefile" \
65
    "etc/apache2/sites-enabled/$instancefile" \
65
    "etc/apache2/sites-enabled/$instancefile" \
66
    "etc/rsyslog.d/99-$name.conf" \
66
    "var/lib/koha/$name" \
67
    "var/lib/koha/$name" \
67
    "var/log/koha/$name"
68
    "var/log/koha/$name"
68
69
(-)a/debian/scripts/koha-remove (+2 lines)
Lines 81-86 eof Link Here
81
81
82
    [ -f "$instancefile" ]  && \
82
    [ -f "$instancefile" ]  && \
83
        rm "$instancefile"
83
        rm "$instancefile"
84
    [ -f "/etc/rsyslog.d/99-$name.conf" ] && \
85
        rm "/etc/rsyslog.d/99-$name.conf"
84
    [ -f "/etc/koha/sites/$name/koha-conf.xml" ] && \
86
    [ -f "/etc/koha/sites/$name/koha-conf.xml" ] && \
85
        rm "/etc/koha/sites/$name/koha-conf.xml"
87
        rm "/etc/koha/sites/$name/koha-conf.xml"
86
    [ -f "/etc/koha/sites/$name/zebra-biblios.cfg" ] && \
88
    [ -f "/etc/koha/sites/$name/zebra-biblios.cfg" ] && \
(-)a/debian/templates/koha-conf-site.xml.in (+4 lines)
Lines 248-253 Link Here
248
-->
248
-->
249
249
250
<config>
250
<config>
251
 <kohasite>__KOHASITE__</kohasite>
251
 <db_scheme>mysql</db_scheme>
252
 <db_scheme>mysql</db_scheme>
252
 <database>__DB_NAME__</database>
253
 <database>__DB_NAME__</database>
253
 <hostname>__DB_HOST__</hostname>
254
 <hostname>__DB_HOST__</hostname>
Lines 282-287 Link Here
282
 <zebra_auth_index_mode>__AUTHORITIES_INDEXING_MODE__</zebra_auth_index_mode>
283
 <zebra_auth_index_mode>__AUTHORITIES_INDEXING_MODE__</zebra_auth_index_mode>
283
 <zebra_lockdir>/var/lock/koha/__KOHASITE__</zebra_lockdir>
284
 <zebra_lockdir>/var/lock/koha/__KOHASITE__</zebra_lockdir>
284
 <queryparser_config>/etc/koha/searchengine/queryparser.yaml</queryparser_config>
285
 <queryparser_config>/etc/koha/searchengine/queryparser.yaml</queryparser_config>
286
 <!--
287
 <syslog_facility>user</syslog_facility>
288
 -->
285
</config>
289
</config>
286
290
287
</yazgfs>
291
</yazgfs>
(-)a/debian/templates/rsyslog-site.conf.in (+2 lines)
Line 0 Link Here
1
if $programname == '__KOHASITE__' then /var/log/koha/__KOHASITE__/action.log
2
if $programname == '__KOHASITE__' then ~
(-)a/t/Log.t (-1 / +1 lines)
Lines 13-18 BEGIN { Link Here
13
        use_ok('C4::Log');
13
        use_ok('C4::Log');
14
}
14
}
15
15
16
t::lib::Mocks::mock_config('syslog_facility', 'user');
16
t::lib::Mocks::mock_preference('BorrowersLog', 1);
17
t::lib::Mocks::mock_preference('BorrowersLog', 1);
17
t::lib::Mocks::mock_preference('CataloguingLog', 1);
18
t::lib::Mocks::mock_preference('CataloguingLog', 1);
18
t::lib::Mocks::mock_preference('IssueLog', 1);
19
t::lib::Mocks::mock_preference('IssueLog', 1);
19
- 

Return to bug 12952