Skip to content

Commit

Permalink
resubmit commit to fix Server Logs for Ubuntu OS
Browse files Browse the repository at this point in the history
  • Loading branch information
meramsey committed Oct 15, 2019
1 parent eaee1bc commit b011641
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions serverLogs/views.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from plogical.virtualHostUtilities import virtualHostUtilities
from plogical.acl import ACLManager
from plogical.processUtilities import ProcessUtilities
import os
# Create your views here.


Expand Down Expand Up @@ -130,9 +131,15 @@ def getLogsFromFile(request):
elif type == "error":
fileName = installUtilities.Server_root_path + "/logs/error.log"
elif type == "email":
fileName = "/var/log/maillog"
if ProcessUtilities.decideDistro() == ProcessUtilities.centos:
fileName = "/var/log/maillog"
else:
fileName = "/var/log/mail.log"
elif type == "ftp":
fileName = "/var/log/messages"
if ProcessUtilities.decideDistro() == ProcessUtilities.centos:
fileName = "/var/log/messages"
else:
fileName = "/var/log/syslog"
elif type == "modSec":
fileName = "/usr/local/lsws/logs/auditmodsec.log"
elif type == "cyberpanel":
Expand Down Expand Up @@ -195,4 +202,4 @@ def clearLogFile(request):
logging.CyberCPLogFileWriter.writeToFile(str(msg))
data_ret = {'cleanStatus': 0, 'error_message': str(msg)}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
return HttpResponse(json_data)

0 comments on commit b011641

Please sign in to comment.