Skip to content

Commit

Permalink
Logs now follow RFC3339 format for time
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaweedbrainCY committed Nov 10, 2024
1 parent 88ec2a9 commit 76adb0e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions api/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, data) -> None:
logging.basicConfig(
format='%(asctime)s %(levelname)-8s %(message)s',
level=logging.DEBUG,
datefmt='%d-%m-%Y %H:%M:%S')
datefmt='%Y-%m-%dT%H:%M:%SZ%z')
logging.debug("Environment set to development")
if "frontend_URI" not in data:
logging.error("[FATAL] Load config fail. In local environement, was expecting the key environment.frontend_URI")
Expand All @@ -35,9 +35,11 @@ def __init__(self, data) -> None:
elif data["type"] == "development":
self.type = "development"
logging.basicConfig(
filename="/var/log/api/api.log",
filemode='a',
format='%(asctime)s %(levelname)-8s %(message)s',
level=logging.INFO,
datefmt='%d-%m-%Y %H:%M:%S')
datefmt='%Y-%m-%dT%H:%M:%SZ%z')
logging.info("Environment set to development")
self.frontend_URI = f"https://{data['domain']}"
self.callback_URI = f"https://{data['domain']}/api/v1/google-drive/oauth/callback"
Expand All @@ -48,7 +50,7 @@ def __init__(self, data) -> None:
filemode='a',
format='%(asctime)s %(levelname)-8s %(message)s',
level=logging.INFO,
datefmt='%d-%m-%Y %H:%M:%S')
datefmt='%Y-%m-%dT%H:%M:%SZ%z')
self.frontend_URI = f"https://{data['domain']}"
self.callback_URI = f"https://{data['domain']}/api/v1/google-drive/oauth/callback"

Expand Down

0 comments on commit 76adb0e

Please sign in to comment.