Send Logs
post
https://connectapi.jfrog.io/v1/
send_log_file
Send Logs
Restrictions:
  • Max file size: 20Mb
  • Max calls per minute per device: 1
  • Max total files that are being saved on Connect servers: 30. If you upload a file with a name that already exists, it will be overridden. If you upload more than 30 files in total, the oldest file uploaded will be deleted and replaced by the new file.

Example

Python
1
import json
2
import requests
3
4
5
#Upswift tokens
6
user_token = "<user token>"
7
device_token = "<device token>"
8
9
json_content = {'user_token': user_token,
10
'device_token': device_token}
11
12
13
file_name = "log.txt"
14
file_path = "/home/logs/log.txt"
15
16
json_payload = (None, json.dumps(json_content), 'application/json')
17
file_payload = (file_name, open(file_path, 'rb'), 'application/octet-stream')
18
final_payload = {'json': json_payload,'file': file_payload}
19
20
call_request = requests.post("https://connectapi.jfrog.io/v1/send_log_file", files=final_payload)
21
call_response = json.loads(call_request.text)
22
23
if call_request.status_code != 200:
24
if call_request.status_code == 429:
25
error = "API limit reached"
26
else:
27
error = call_response["error_message"]
28
print(error)
29
else:
30
response_message = call_response["message"]
31
Copied!
Copy link