/** * Class constructor * * @param string $file The path to the file to use for loggin * @param string $format The format of the log file * @param strign $time The timestamp format */ public function __construct($file, $format = '%time% %level% %type% %message%%EOL%', $time = '%b %d %H:%M:%S') { parent::__construct(); // init vars $this->_format = $format; $this->_time = $time; $this->_file = $file; $this->_fp = fopen($file, 'a'); }
/** * Class constructor * * @param string $email The email address * @param string $format The format of the email with placeholders * @param string $time The timeformat to user */ public function __construct($email, $format = '%time% %level% %type% %message%%EOL%', $time = '%b %d %H:%M:%S') { parent::__construct(); // init vars $this->_format = $format; $this->_time = $time; $this->_email = $email; $this->_log = ''; }
<?php include_once "/var/www/html/libs/paloSantoDB.class.php"; include_once "/var/www/html/modules/hispana_campania_derivada/configs/default.conf.php"; include_once "/var/www/html/modules/hispana_campania_derivada/libs/paloSantoCampaniaDerivada.class.php"; include_once "/var/www/html/modules/hispana_campania_derivada/libs/AppLogger.class.php"; $_log = new AppLogger(); $_log->open("/var/www/html/modules/hispana_campania_derivada/_log.log"); $_log->prefijo("ajax_process"); $_log->output("POST:" . print_r($_POST, true)); if (isset($_POST['action'])) { $pDB = new paloDB($arrConfModule['dsn_conn_database']); $pCampaniaDerivada = new paloSantoCampaniaDerivada($pDB); switch ($_POST['action']) { case 'getBases': $arrBases = $pCampaniaDerivada->getBases($_POST['campania']); // $_log->output("Bases:\n" . print_r($arrBases,true)); if (sizeof($arrBases) > 0) { $content = crearOption($arrBases); $_log->output("Content: " . $content); } else { $content = '<option id=0>No hay bases</option>.'; } break; case 'getCalltypes': $arrCalltypes = $pCampaniaDerivada->getCalltypes($_POST['campania']); if (sizeof($arrCalltypes) > 0) { $content = crearOption($arrCalltypes); // $_log->output("Content: " . $content); } else { $content = '<option id=0>No hay calltypes</option>.';