CC-2186: Integration of a logger tool

-initial check-in. Everything appears to be working...
This commit is contained in:
martin 2011-04-20 00:46:03 -04:00
parent 3b1e79a5d8
commit 171828f8ad
6 changed files with 50 additions and 5 deletions

View file

@ -8,6 +8,7 @@ class AirtimeInstall
const CONF_DIR_BINARIES = "/usr/lib/airtime";
const CONF_DIR_STORAGE = "/srv/airtime";
const CONF_DIR_WWW = "/var/www/airtime";
const CONF_DIR_LOG = "/var/log/airtime";
public static function GetAirtimeSrcDir()
{
@ -318,4 +319,28 @@ class AirtimeInstall
}
}
}
public static function CreateZendPhpLogFile(){
global $CC_CONFIG;
echo "* Creating logs directory ".AirtimeInstall::CONF_DIR_LOG.PHP_EOL;
$path = AirtimeInstall::CONF_DIR_LOG;
$file = $path.'/zendphp.log';
if (!file_exists($path)){
mkdir($path, 0755, true);
}
touch($file);
chmod($file, 0755);
chown($file, $CC_CONFIG['webServerUser']);
chgrp($file, $CC_CONFIG['webServerUser']);
}
public static function RemoveLogDirectories(){
$path = AirtimeInstall::CONF_DIR_LOG;
echo "* Removing logs directory ".$path.PHP_EOL;
exec("rm -rf $path");
}
}