summaryrefslogtreecommitdiff
path: root/program/include/main.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2009-10-01 06:50:48 +0000
committerthomascube <thomas@roundcube.net>2009-10-01 06:50:48 +0000
commitcb89616e1d7117a9d9e44ffc01fa6bcec0c1cdab (patch)
tree39df968bc66f1c4cadf834eb508cc3d585775ea4 /program/include/main.inc
parentbf1b66bf1d6eb000938f0080042fce0919976a94 (diff)
Trigger warning if logs cannot be written
Diffstat (limited to 'program/include/main.inc')
-rw-r--r--program/include/main.inc5
1 files changed, 4 insertions, 1 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index 97a3db16c..6e4cbe1bc 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -1042,12 +1042,15 @@ function write_log($name, $line)
$CONFIG['log_dir'] = INSTALL_PATH.'logs';
// try to open specific log file for writing
- if ($fp = @fopen($CONFIG['log_dir'].'/'.$name, 'a')) {
+ $logfile = $CONFIG['log_dir'].'/'.$name;
+ if ($fp = @fopen($logfile, 'a')) {
fwrite($fp, $log_entry);
fflush($fp);
fclose($fp);
return true;
}
+ else
+ trigger_error("Error writing to log file $logfile; Please check permissions", E_USER_WARNING);
}
return false;
}