Created attachment 154338 [details] Flush Connexion Import Daemon Log The connexion_import_daemon.pl tool can output logs to the location specified in its config file, but because it uses buffered files (fine) and never flushes the buffer (not fine) the latest log entries are not available until additional records are submitted or the daemon is restarted and the log filehandle closed. The attached patch flushes the log only at the end of the request so the logs are usefully up to date without spamming i/o flushes on every call to log(). To test, pre-patch: 1. Export or locate a single marc record in binary format 2. Setup the connexion_import_daemon.pl as in https://koha-community.org/manual/19.11/en/html/third_party_software.html#oclc-connexion-gateway and take note of the logging location 3. Using Connexion or netcat, send the record to the specified port ( nc koha-host 8000 < recrd.mrc ) 4. Check the logfile configured in 2. It will likely end somewhere in the middle of the "Response: XYZ" output (probably somewhere in the middle of some marcxml) 5. Stop the daemon and verify that the remainder of the response is logged 6. Apply the patch 7. Restart the import daemon and resend the record from step 3 8. This time the full response should be logged as soon as the record is sent