Browse Source

Logging warning on a failed try to send to logz.io (#56)

Logging error only if all retries fails
opensearch
Adar Hilsenrat 5 years ago
committed by GitHub
parent
commit
fb5c06eb8b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      logzio/sender.py

+ 2
- 2
logzio/sender.py View File

@ -145,7 +145,7 @@ class LogzioSender:
should_backup_to_disk = False should_backup_to_disk = False
break break
except Exception as e: except Exception as e:
self.logger.error(
self.logger.warning(
'Got exception while sending logs to Logz.io, ' 'Got exception while sending logs to Logz.io, '
'Try (%s/%s). Message: %s', 'Try (%s/%s). Message: %s',
current_try + 1, number_of_retries, e) current_try + 1, number_of_retries, e)
@ -157,7 +157,7 @@ class LogzioSender:
if should_backup_to_disk and self.backup_logs: if should_backup_to_disk and self.backup_logs:
# Write to file # Write to file
self.logger.info(
self.logger.error(
'Could not send logs to Logz.io after %s tries, ' 'Could not send logs to Logz.io after %s tries, '
'backing up to local file system', number_of_retries) 'backing up to local file system', number_of_retries)
backup_logs(logs_list, self.logger) backup_logs(logs_list, self.logger)


Loading…
Cancel
Save