Fakultas Ilmu Komputer UI

Commit 81449258 authored by Alfina Megasiwi's avatar Alfina Megasiwi
Browse files

Merge branch 'fina-logging' into 'master'

Fina logging

See merge request !6
parents 41d69697 0143e7cf
Pipeline #138788 passed with stage
in 1 minute and 49 seconds
import json
from django.urls import resolve
from datetime import datetime
import datetime
import pytz
from log import API_LOGGER_SIGNAL
from log.utils import get_headers, mask_sensitive_data
......@@ -62,9 +63,10 @@ class APILoggerMiddleware:
except Exception as v:
print("validation error", v)
time_now_zone = datetime.datetime.now(pytz.timezone("Asia/Jakarta"))
date_time_str = time_now_zone.strftime("%Y-%m-%d %H:%M:%S")
data = dict(
time=datetime.now(),
time= date_time_str,
service="auth-remindme",
type=type_log,
host=mask_sensitive_data(headers).get("HOST"),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment