public static function log($message, $detail = "")
 {
     $log = "";
     foreach ($message as $key => $value) {
         $log .= $key . "=\"" . $value . "\" ";
     }
     $log .= " " . $detail;
     $log .= " script=\"" . $_SERVER["SCRIPT_FILENAME"] . " session=\"" . $_REQUEST["PHPSESSID"] . "\" addr=\"" . $_ENV["REMOTE_ADDR"] . "\"";
     logFactory::splunk($log);
 }
예제 #2
0
 function compress()
 {
     logFactory::log($this, "Using " . $this->mode);
     global $upload_folder, $zip_folder;
     if ($this->mode == "terminal") {
         $res = array();
         $command = "zip " . $zip_folder . $this->zip_name . " " . implode(" ", $this->files);
         exec($command, $res);
         logFactory::log($this, $command);
         logFactory::log($this, implode(",", $res));
     } else {
         $zip = new ZipArchive();
         $filename = $zip_folder . $this->zip_name;
         if ($zip->open($filename, ZIPARCHIVE::CREATE) == TRUE) {
             foreach ($this->files as $file) {
                 $zip->addFile($upload_folder . $file);
             }
             $zip->close();
         }
     }
 }
예제 #3
0
 public static function splunk($message)
 {
     global $log_folder;
     logFactory::checkSize($log_folder . "splunk.log");
     error_log(str_pad(date("Y-m-d h:i:s"), 20) . " logger=\"splunk\" " . str_pad($class, 20) . " " . $message . "\n", 3, LOG_FOLDER . "/splunk.log");
 }
 function sendMail()
 {
     logFactory::log("SendMail", "recipient = \"" . $this->to . "\" subject= \"" . $this->subject . "\" body = \"" . $this->body . "\" script = \"" . $_SERVER['SCRIPT_FILENAME'] . "\" user_id = \"" . $_SESSION["user_id"] . "\"");
     return mail($this->to, $this->subject, $this->body, "From:" . $this->from . "\r\nReply-to: " . $this->from . "\r\nContent-type: text/html; charset=us-ascii");
 }
예제 #5
0
 /**
  * @author Mauricio Giraldo
  * @desc Error management
  * @version 1.0 03/05/2010
  * @param $error The error reported
  * @return NONE
  */
 private function errorLog($error)
 {
     logFactory::error($this, $error);
 }