def setup_logrotate(app_name, watch, log_size):
 app_logrotate_script = '{0}/appscale-{1}'.format(LOGROTATE_CONFIG_DIR, app_name)
 contents = '/var/log/appscale/{watch}*.log {{\n  size {size}\n  missingok\n  rotate 7\n  compress\n  delaycompress\n  notifempty\n  copytruncate\n}}\n'.format(watch=watch, size=log_size)
 logging.debug('Logrotate file: {} - Contents:\n{}'.format(app_logrotate_script, contents))
 with open(app_logrotate_script, 'w') as app_logrotate_fd:
  app_logrotate_fd.write(contents)
 return True

def setup_logrotate ( app_name , watch , log_size ) : app_logrotate_script = '{0}/appscale-{1}' . format ( LOGROTATE_CONFIG_DIR , app_name ) contents = '/var/log/appscale/{watch}*.log {{\n  size {size}\n  missingok\n  rotate 7\n  compress\n  delaycompress\n  notifempty\n  copytruncate\n}}\n' . format ( watch = watch , size = log_size ) logging . debug ( 'Logrotate file: {} - Contents:\n{}' . format ( app_logrotate_script , contents ) ) with open ( app_logrotate_script , 'w' ) as app_logrotate_fd : app_logrotate_fd . write ( contents ) return True
creates a logrotate script for the logs that the given application will create .