CC-2186: Integration of a logger tool
-initial check-in. Everything appears to be working...
This commit is contained in:
parent
3b1e79a5d8
commit
171828f8ad
6 changed files with 50 additions and 5 deletions
|
@ -10,6 +10,7 @@ Propel::init(__DIR__."/configs/airtime-conf.php");
|
|||
$tz = ini_get('date.timezone') ? ini_get('date.timezone') : 'UTC';
|
||||
date_default_timezone_set($tz);
|
||||
|
||||
require_once __DIR__."/logging/Logging.php";
|
||||
require_once __DIR__."/configs/constants.php";
|
||||
require_once __DIR__."/configs/conf.php";
|
||||
require_once 'DB.php';
|
||||
|
@ -33,8 +34,8 @@ if (PEAR::isError($CC_DBC)) {
|
|||
exit(1);
|
||||
}
|
||||
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
Logging::setLogPath('/var/log/airtime/zendphp.log');
|
||||
|
||||
//Zend_Session::start();
|
||||
Zend_Validate::setDefaultNamespaces("Zend");
|
||||
|
||||
$front = Zend_Controller_Front::getInstance();
|
||||
|
|
19
airtime_mvc/application/logging/Logging.php
Normal file
19
airtime_mvc/application/logging/Logging.php
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
class Logging {
|
||||
|
||||
private static $_logger;
|
||||
private static $_path;
|
||||
|
||||
public static function getLogger(){
|
||||
if (!isset(self::$logger)) {
|
||||
$writer = new Zend_Log_Writer_Stream(self::$_path);
|
||||
self::$_logger = new Zend_Log($writer);
|
||||
}
|
||||
return self::$_logger;
|
||||
}
|
||||
|
||||
public static function setLogPath($path){
|
||||
self::$_path = $path;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue