diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-08-27 10:58:33 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-08-27 10:58:33 +0000 |
| commit | 1f08b4d3e99d7955cf62cdaac0123de79b1acdb2 (patch) | |
| tree | add66a586aa27931f1c5bb4a36f8b6eaa743a960 /roundcubemail/program/include/main.inc | |
| parent | e90425d8c5a3cd3c03cdd3a8252d78bc516cebf5 (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
git-svn-id: https://svn.roundcube.net/trunk@1683 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/main.inc')
| -rw-r--r-- | roundcubemail/program/include/main.inc | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc index d79bd01d2..2b4797873 100644 --- a/roundcubemail/program/include/main.inc +++ b/roundcubemail/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); } } +} /** |
