diff --git a/etc/object-server.conf-sample b/etc/object-server.conf-sample index 00fce516f6..714279c9bc 100644 --- a/etc/object-server.conf-sample +++ b/etc/object-server.conf-sample @@ -135,6 +135,10 @@ use = egg:swift#recon # # ring_check_interval = 15 # recon_cache_path = /var/cache/swift +# +# limits how long rsync error log lines are +# 0 means to log the entire line +# rsync_error_log_line_length = 0 [object-updater] # You can override the default log routing for this app here (don't use set!): diff --git a/swift/obj/replicator.py b/swift/obj/replicator.py index b3ffa10f51..2f76057601 100644 --- a/swift/obj/replicator.py +++ b/swift/obj/replicator.py @@ -81,6 +81,8 @@ class ObjectReplicator(Daemon): self.headers = { 'Content-Length': '0', 'user-agent': 'obj-replicator %s' % os.getpid()} + self.rsync_error_log_line_length = \ + int(conf.get('rsync_error_log_line_length', 0)) def _rsync(self, args): """ @@ -112,8 +114,11 @@ class ObjectReplicator(Daemon): else: self.logger.error(result) if ret_val: - self.logger.error(_('Bad rsync return code: %(ret)d <- %(args)s'), - {'args': str(args), 'ret': ret_val}) + error_line = _('Bad rsync return code: %(ret)d <- %(args)s') % \ + {'args': str(args), 'ret': ret_val} + if self.rsync_error_log_line_length: + error_line = error_line[:self.rsync_error_log_line_length] + self.logger.error(error_line) elif results: self.logger.info( _("Successful rsync of %(src)s at %(dst)s (%(time).03f)"),