summaryrefslogtreecommitdiff
path: root/program/include/main.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-08-27 10:58:33 +0000
committeralecpl <alec@alec.pl>2008-08-27 10:58:33 +0000
commitb77d0dd6c5574d9841cd5d040dfcc351a58ccb82 (patch)
tree6c8e872c3d4be368f2fa631f2421d3935e71ab21 /program/include/main.inc
parentd5c539942e3cb4ad623a3f3f0344fc45af371981 (diff)
- added options to use syslog instead of log file (#1484850)
- added Logging & Debugging section in Installer - fixed config from $_POST for next installer steps saving - fixed and re-enabled debug_level setting in installer
Diffstat (limited to 'program/include/main.inc')
-rw-r--r--program/include/main.inc22
1 files changed, 15 insertions, 7 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index d79bd01d2..2b4797873 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -828,16 +828,24 @@ function write_log($name, $line)
date("d-M-Y H:i:s O", mktime()),
$line);
- if (empty($CONFIG['log_dir']))
- $CONFIG['log_dir'] = INSTALL_PATH.'logs';
+ if ($CONFIG['log_driver'] == 'syslog') {
+ if ($name == 'errors')
+ $prio = LOG_ERR;
+ else
+ $prio = LOG_INFO;
+ syslog($prio, $log_entry);
+ } else {
+ // log_driver == 'file' is assumed here
+ if (empty($CONFIG['log_dir']))
+ $CONFIG['log_dir'] = INSTALL_PATH.'logs';
- // try to open specific log file for writing
- if ($fp = @fopen($CONFIG['log_dir'].'/'.$name, 'a'))
- {
- fwrite($fp, $log_entry);
- fclose($fp);
+ // try to open specific log file for writing
+ if ($fp = @fopen($CONFIG['log_dir'].'/'.$name, 'a')) {
+ fwrite($fp, $log_entry);
+ fclose($fp);
}
}
+}
/**