title: Why does Python RotatingFileHandler's "maxBytes " not work
body: <p>I'm trying to do a test run of the <code>logging</code> module's RotatingFileHandler as follows:</p>
  
  <pre><code>from logging import getLogger, Formatter
  from logging.handlers import RotatingFileHandler
  
  MAX_LOG_SIZE = 2000
  
  _null = lambda *s: None
  LOG_FORMAT = '%(process)d [%(name)s %(asctime)s] %(levelname)s: %(message)s'
  
  class Logger(object):
      __slots__ = '_Logger__logger'
  
      def __init__(self, name='main'):
          self.__logger = getLogger(name)
          if not self.__logger.handlers:
              self.add_handler(name)
  
      def add_handler(self, name):
  
          file_name = 'log.log'
          handler = RotatingFileHandler(file_name, 'a+', MAX_LOG_SIZE)
          handler.setFormatter(Formatter(LOG_FORMAT))
          self.__logger.addHandler(handler)
          self.__logger._file_name = file_name
  
      def ERROR(self, msg, *args):
          self.__logger.error(msg, *args, **{})
  
  if __name__ == '__main__':
      logger = Logger()
      for i in range(1000):
          logger.ERROR('logger.content')
  </code></pre>
  
  <p>However, with MAX_LOG_SIZE = 2000, the resulting of log.log file contains too much data large than 2000 bytes</p>
  
  <p>How can I limit max size of the logfile?</p>