make access log fetch compatible with Michael commit

This commit is contained in:
Usman Nasir
2020-02-03 17:30:24 +05:00
parent 0d6b7a9c4c
commit 829c8c8b59
4 changed files with 12 additions and 12 deletions

View File

@@ -1004,7 +1004,7 @@ class WebsiteManager:
if output.find("1,None") > -1:
final_json = json.dumps(
{'status': 0, 'logstatus': 0, 'error_message': "Not able to fetch logs, see CyberPanel main log file!"})
{'status': 0, 'logstatus': 0, 'error_message': "Not able to fetch logs, see CyberPanel main log file, Error: %s" % (output)})
return HttpResponse(final_json)
## get log ends here.
@@ -1017,11 +1017,11 @@ class WebsiteManager:
for items in reversed(data):
if len(items) > 10:
logData = items.split(" ")
domain = logData[0].strip('"')
ipAddress = logData[1]
time = (logData[4]).strip("[").strip("]")
resource = logData[7].strip('"')
size = logData[10].replace('"', '')
domain = logData[5].strip('"')
ipAddress = logData[0].strip('"')
time = (logData[3]).strip("[").strip("]")
resource = logData[6].strip('"')
size = logData[9].replace('"', '')
dic = {'domain': domain,
'ipAddress': ipAddress,