mirror of
https://github.com/wolfswolke/DeathGarden_API_Rebirth.git
synced 2026-08-19 23:54:00 -05:00
Old ES_Logger. Will be removed soon...
This commit is contained in:
@@ -12,3 +12,17 @@ def es_upload(server, index, log_message):
|
||||
response = es.index(index=index, body=data, headers={'Content-Type': 'application/json;charset=UTF-8'})
|
||||
document_id = response['_id']
|
||||
print("Uploaded dictionary with ID:", document_id)
|
||||
|
||||
|
||||
def dev_es_upload(server, index, log_message):
|
||||
if index == "client_event":
|
||||
playerUniqueId = log_message["playerUniqueId"]
|
||||
clientEvent = log_message["clientEvent"]
|
||||
eventType = log_message["eventType"]
|
||||
timestamp = datetime.utcnow().isoformat()
|
||||
upload_string = "Message: {}. Sender: {}.".format(clientEvent, playerUniqueId)
|
||||
upload_message = {"msg_type": "error", "timestamp": timestamp, "message": upload_string, "type": "string"}
|
||||
es = Elasticsearch(server)
|
||||
response = es.index(index="dev_client_event", body=upload_message)
|
||||
document_id = response['_id']
|
||||
print("Uploaded dictionary with ID:", document_id)
|
||||
|
||||
Reference in New Issue
Block a user