Skip to content

Commit

Permalink
lg: Strip secret from logs
Browse files Browse the repository at this point in the history
  • Loading branch information
dueringa committed Jul 11, 2024
1 parent fde3cd9 commit 8c1085f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lg.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,12 @@ async def bird_proxy(
status = True # retreive remote status
except HTTPError as ex:
status = False
url = re.sub(r"secret=[^&]*", "", url)
result = f"HTTP Error occurred on {host}: {ex.status}"
app.logger.warning("Failed to retrieve URL for host %s: %s", host, url)
app.logger.warning("HTTP Error occurred: %s", ex.status)
except IOError:
url = re.sub(r"secret=[^&]*", "", url)
result = f"Failed to retrieve data from host {host}"
app.logger.warning("Failed to retrieve URL for host %s: %s", host, url)

Expand Down

0 comments on commit 8c1085f

Please sign in to comment.