diff --git a/C4/SIP/Sip.pm b/C4/SIP/Sip.pm index 8a0f067dac..337cc0e4d0 100644 --- a/C4/SIP/Sip.pm +++ b/C4/SIP/Sip.pm @@ -12,6 +12,7 @@ use Exporter; use Sys::Syslog qw(syslog); use POSIX qw(strftime); use Socket qw(:crlf); +use IO::Handle; use Sip::Constants qw(SIP_DATETIME); use Sip::Checksum qw(checksum); @@ -230,9 +231,11 @@ sub write_msg { if ($file) { + $file->autoflush(1); print $file "$msg\r"; } else { - print "$msg\r"; + STDOUT->autoflush(1); + print $msg, "\r"; syslog("LOG_INFO", "OUTPUT MSG: '$msg'"); }