function logline($ll, $msg) { global $LOGLEVEL, $LOG, $MAXLOGSIZE, $LOGFILE; if ($LOGLEVEL and $ll <= $LOGLEVEL) { $LOG = fopen($LOGFILE, "a"); if ($LOG) { fwrite($LOG, date("d.m.Y H:i:s") . " - {$msg}\r\n"); $lstat = fstat($LOG); if ($lstat["size"] > $MAXLOGSIZE) { rotatelog(); } fclose($LOG); } } }
function log_line_to_file($debug, $msg) { global $LOG, $LOG_DEBUG, $MAXLOGSIZE, $LOGFILE, $LOGFILEHANDLE; if ($LOG && (!$debug || $LOG_DEBUG)) { $LOGFILEHANDLE = fopen($LOGFILE, "a"); if ($LOGFILEHANDLE) { fwrite($LOGFILEHANDLE, date("d.m.Y H:i:s") . " - {$msg}\r\n"); $lstat = fstat($LOGFILEHANDLE); if ($lstat["size"] > $MAXLOGSIZE) { rotatelog(); } fclose($LOGFILEHANDLE); } } }