diff --git a/C4/SIP/SIPServer.pm b/C4/SIP/SIPServer.pm index c7aa22297c..81280c5095 100755 --- a/C4/SIP/SIPServer.pm +++ b/C4/SIP/SIPServer.pm @@ -30,6 +30,9 @@ use base qw(Net::Server::PreFork); use constant LOG_SIP => "local6"; # Local alias for the logging facility + +set_logger( Koha::Logger->get( { interface => 'sip' } ) ); + # # Main # not really, since package SIPServer # diff --git a/C4/SIP/Sip/Configuration.pm b/C4/SIP/Sip/Configuration.pm index fd2c3e79cd..9c0a8cb84e 100644 --- a/C4/SIP/Sip/Configuration.pm +++ b/C4/SIP/Sip/Configuration.pm @@ -9,8 +9,10 @@ package C4::SIP::Sip::Configuration; use strict; use warnings; use XML::Simple qw(:strict); +use List::Util qw(uniq); use C4::SIP::Sip qw(siplog); +use Koha::Libraries; my $parser = new XML::Simple( KeyAttr => { @@ -47,6 +49,12 @@ sub new { } $cfg->{listeners} = \%listeners; + my @branchcodes = Koha::Libraries->search()->get_column('branchcode'); + my @institutions = uniq( keys %{ $cfg->{institutions} } ); + foreach my $i ( @institutions ) { + siplog("LOG_ERR", "ERROR: Institution $i does does not match a branchcode. This can cause unexpected behavior.") unless grep( /^$i$/, @branchcodes ); + } + return bless $cfg, $class; }