keeps only errors on logging

This commit is contained in:
Seddik Alaoui Ismaili 2023-11-15 00:22:30 +01:00 committed by zlopez
parent 03edf77f12
commit 246cc76260

View file

@ -119,7 +119,7 @@ def sync_http_logs(synced_host):
return return
raise raise
log.info("Started sync from %s.", synced_host) # log.info("Started sync from %s.", synced_host)
send_sync_msg("sync.host.start", synced_host=synced_host) send_sync_msg("sync.host.start", synced_host=synced_host)
for days_in_past in range(1, DAYS_TO_FETCH + 1): for days_in_past in range(1, DAYS_TO_FETCH + 1):
@ -138,13 +138,13 @@ def sync_http_logs(synced_host):
target_dir_undated.mkdir(parents=True, exist_ok=True) target_dir_undated.mkdir(parents=True, exist_ok=True)
target_dir_dated.mkdir(exist_ok=True) target_dir_dated.mkdir(exist_ok=True)
log.info( # log.info(
"... host %s, log date %s, seeding dated logfiles from undated", synced_host, log_date # "log.info %s, log date %s, seeding dated logfiles from undated", synced_host, log_date
) # )
seed_dated_logfiles(date, target_dir_undated, target_dir_dated) seed_dated_logfiles(date, target_dir_undated, target_dir_dated)
for attempt in range(1, RETRY_ATTEMPTS + 1): for attempt in range(1, RETRY_ATTEMPTS + 1):
log.info("... host %s, log date %s, attempt %d", synced_host, log_date, attempt) # log.info("... host %s, log date %s, attempt %d", synced_host, log_date, attempt)
try: try:
exitcode = subprocess.call( exitcode = subprocess.call(
RSYNC_CMD + [f"{synced_host}::log/httpd/*{date_str}*", str(target_dir_dated)], RSYNC_CMD + [f"{synced_host}::log/httpd/*{date_str}*", str(target_dir_dated)],
@ -169,16 +169,16 @@ def sync_http_logs(synced_host):
) )
send_sync_msg(topic, synced_host=synced_host, log_date=log_date, reason=reason) send_sync_msg(topic, synced_host=synced_host, log_date=log_date, reason=reason)
log.info( # log.info(
"... host %s, log date %s, linking back undated logfiles from dated", # "... host %s, log date %s, linking back undated logfiles from dated",
synced_host, # synced_host,
log_date, # log_date,
) # )
link_back_undated_logfiles(date, target_dir_dated, target_dir_undated) link_back_undated_logfiles(date, target_dir_dated, target_dir_undated)
send_sync_msg("sync.host.logdate.finish", synced_host=synced_host, log_date=log_date) send_sync_msg("sync.host.logdate.finish", synced_host=synced_host, log_date=log_date)
log.info(f"Finished sync from {synced_host}.") # log.info(f"c{synced_host}.")
send_sync_msg("sync.host.finish", synced_host=synced_host) send_sync_msg("sync.host.finish", synced_host=synced_host)