Skip to content

Commit f306d5c

Browse files
authored
VED-994: Fix log format in backend Lambdas. (#1091)
1 parent 3cf6aeb commit f306d5c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lambdas/backend/src/log_structure.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ def wrapper(*args, **kwargs):
7979
"actual_path": actual_path,
8080
"resource_path": resource_path,
8181
}
82-
firehose_log = {}
8382
start = time.time()
8483
try:
8584
result = func(*args, **kwargs)
@@ -90,8 +89,7 @@ def wrapper(*args, **kwargs):
9089

9190
log_data["operation_outcome"] = operation_outcome
9291
logger.info(json.dumps(log_data))
93-
firehose_log["event"] = log_data
94-
send_log_to_firehose(STREAM_NAME, firehose_log)
92+
send_log_to_firehose(STREAM_NAME, log_data)
9593
return result
9694

9795
except Exception as e:
@@ -100,8 +98,7 @@ def wrapper(*args, **kwargs):
10098
log_data["time_taken"] = f"{round(end - start, 5)}s"
10199
log_data.update(_log_data_from_body(event))
102100
logger.exception(json.dumps(log_data))
103-
firehose_log["event"] = log_data
104-
send_log_to_firehose(STREAM_NAME, firehose_log)
101+
send_log_to_firehose(STREAM_NAME, log_data)
105102
raise
106103

107104
return wrapper

0 commit comments

Comments
 (0)