From 5cf7aae17829f1364bef6d44ef92ebb7d5edf9a8 Mon Sep 17 00:00:00 2001 From: alecpl Date: Mon, 23 Aug 2010 10:23:20 +0000 Subject: - Don't add date to log when using syslog --- program/include/main.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'program') diff --git a/program/include/main.inc b/program/include/main.inc index ff535947d..f9ce5476e 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -1117,14 +1117,14 @@ function write_log($name, $line) return true; } - $log_entry = sprintf("[%s]: %s\n", $date, $line); - if ($CONFIG['log_driver'] == 'syslog') { $prio = $name == 'errors' ? LOG_ERR : LOG_INFO; - syslog($prio, $log_entry); + syslog($prio, $line); return true; } else { + $line = sprintf("[%s]: %s\n", $date, $line); + // log_driver == 'file' is assumed here if (empty($CONFIG['log_dir'])) $CONFIG['log_dir'] = INSTALL_PATH.'logs'; @@ -1132,7 +1132,7 @@ function write_log($name, $line) // try to open specific log file for writing $logfile = $CONFIG['log_dir'].'/'.$name; if ($fp = @fopen($logfile, 'a')) { - fwrite($fp, $log_entry); + fwrite($fp, $line); fflush($fp); fclose($fp); return true; -- cgit v1.2.3