Allow to have a custom dir for apache logs

This commit is contained in:
Axel ROGER 2013-04-24 15:26:09 +00:00
parent f782010273
commit 60432b77a9
3 changed files with 12 additions and 3 deletions

View File

@ -97,6 +97,8 @@ require_once(dirname(__FILE__)."/local.php");
// The you can't choose where is the AlternC Panel
define('ALTERNC_MAIL', "$L_ALTERNC_MAIL");
define('ALTERNC_HTML', "$L_ALTERNC_HTML");
if(isset($L_ALTERNC_LOGS_ARCHIVE))
define('ALTERNC_LOGS_ARCHIVE', "$L_ALTERNC_LOGS_ARCHIVE");
define('ALTERNC_LOGS', "$L_ALTERNC_LOGS");
define('WEBSERVERS_LOGS', "$L_WEBSERVERS_LOGS");
define('ALTERNC_PANEL', "/usr/share/alternc/panel");

View File

@ -81,7 +81,11 @@ class m_log {
global $cuid,$mem,$err;
$err->log("log","get_logs_directory");
// Return an array to allow multiple directory in the future
$c=array("dir"=>WEBSERVERS_LOGS."/".$cuid."-".$mem->user["login"]);
if(defined('ALTERNC_LOGS_ARCHIVE')){
$c=array("dir"=>ALTERNC_LOGS_ARCHIVE."/".$cuid."-".$mem->user["login"]);
}else{
$c=array("dir"=>ALTERNC_LOGS."/".$cuid."-".$mem->user["login"]);
}
return $c;
}

View File

@ -126,8 +126,12 @@ INOTIFY_UPDATE_DOMAIN="/var/run/alternc/inotify_do_action.lock"
ALTERNC_HTML=""
ALTERNC_MAIL=""
ALTERNC_LOGS=""
WEBSERVERS_LOGS=""
# Custom directory for archived logs. ALTERNC_LOGS is used by default to view logs files on the panel.
# But you may merge your logs in other directory. In order to view them,
# Uncomment and complete the following variable to use it instead of ALTERNC_LOGS.
#ALTERNC_LOGS_ARCHIVE=""
EOF
chown root:alterncpanel $CONFIGFILE
@ -158,7 +162,6 @@ EOF
update_var alternc/alternc_html ALTERNC_HTML
update_var alternc/alternc_mail ALTERNC_MAIL
update_var alternc/alternc_logs ALTERNC_LOGS
update_var alternc/alternc_logs WEBSERVERS_LOGS
sed -e "$SED_SCRIPT" < $CONFIGFILE > $CONFIGFILE.tmp
mv -f $CONFIGFILE.tmp $CONFIGFILE