From 441faeff8506fae8161577861e8d4603114d6b99 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 23 Feb 2016 15:01:20 +0530 Subject: [PATCH] Allow disabling of log rotation --- src/calibre/srv/opts.py | 2 +- src/calibre/srv/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/srv/opts.py b/src/calibre/srv/opts.py index a881897d69..3aa5a611b9 100644 --- a/src/calibre/srv/opts.py +++ b/src/calibre/srv/opts.py @@ -101,7 +101,7 @@ raw_options = ( 'Max. log file size (in MB)', 'max_log_size', 20, 'The maximum size of log files, generated by the server. When the log becomes larger' - ' than this size, it is automatically rotated.', + ' than this size, it is automatically rotated. Set to zero to disable log rotation.', 'Enable/disable logging of not found http requests', 'log_not_found', True, diff --git a/src/calibre/srv/utils.py b/src/calibre/srv/utils.py index b2a201d2bb..9ad33cf848 100644 --- a/src/calibre/srv/utils.py +++ b/src/calibre/srv/utils.py @@ -347,7 +347,7 @@ class RotatingStream(object): raise def rollover(self): - if self.max_size is None or self.current_pos <= self.max_size or self.filename in ('/dev/stdout', '/dev/stderr'): + if not self.max_size or self.current_pos <= self.max_size or self.filename in ('/dev/stdout', '/dev/stderr'): return self.stream.close() for i in xrange(self.history - 1, 0, -1):