From b011641d4bfe14d20172cc174036e0ea4b7108fe Mon Sep 17 00:00:00 2001 From: Michael Ramsey Date: Mon, 14 Oct 2019 22:23:08 -0400 Subject: [PATCH] resubmit commit to fix Server Logs for Ubuntu OS --- serverLogs/views.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) mode change 100755 => 100644 serverLogs/views.py diff --git a/serverLogs/views.py b/serverLogs/views.py old mode 100755 new mode 100644 index 7bffba1a0..300509a09 --- a/serverLogs/views.py +++ b/serverLogs/views.py @@ -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. @@ -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": @@ -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) \ No newline at end of file + return HttpResponse(json_data)