diff options
author | alecpl <alec@alec.pl> | 2010-08-23 10:23:20 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-08-23 10:23:20 +0000 |
commit | 5cf7aae17829f1364bef6d44ef92ebb7d5edf9a8 (patch) | |
tree | 654a251a2286fd4fa89ebb984cf7c65dc2eabd60 /program | |
parent | 053e5a087cbac7dd9318ac2c60257f9e67207c3e (diff) |
- Don't add date to log when using syslog
Diffstat (limited to 'program')
-rw-r--r-- | program/include/main.inc | 8 |
1 files changed, 4 insertions, 4 deletions
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; |