public function writelog($message) { $logFileDir = LOG_PATH; $logFile = 'monitor' . date('Y-m-d') . '.log'; $log = date('Y-m-d H:i:s') . ' - ' . $message . "\n"; $fp = fopen($logFileDir.$logFile, 'a+'); fwrite($fp, $log); fclose($fp); }