From 5890a1cb48d962bb8b4d8027f235484ecd3ae1e8 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Fri, 30 Jul 2021 09:48:13 -0700 Subject: [PATCH] Fix "message too long" error when logging to rsyslog (#389). --- NEWS | 3 +++ borgmatic/execute.py | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index ba8e675..8bdb008 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +1.5.18 + * #389: Fix "message too long" error when logging to rsyslog. + 1.5.17 * #437: Fix error when configuration file contains "umask" option. * Remove test dependency on vim and /dev/urandom. diff --git a/borgmatic/execute.py b/borgmatic/execute.py index 40d70c5..db6da64 100644 --- a/borgmatic/execute.py +++ b/borgmatic/execute.py @@ -138,9 +138,12 @@ def log_outputs(processes, exclude_stdouts, output_log_level, borg_local_path): if not output_buffer: continue - remaining_output = output_buffer.read().rstrip().decode() + while True: + remaining_output = output_buffer.readline().rstrip().decode() + + if not remaining_output: # pragma: no cover + break - if remaining_output: # pragma: no cover logger.log(output_log_level, remaining_output)