summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
Diffstat (limited to 'program')
-rw-r--r--program/include/main.inc8
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;