Commit 371b727d authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Set LOG_TARGET_FILE default in errors.php; remove misleading dataroot...


Set LOG_TARGET_FILE default in errors.php; remove misleading dataroot reference from config-defaults (bug #738265)
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 5da996ae
...@@ -99,8 +99,10 @@ $cfg->log_environ_targets = LOG_TARGET_SCREEN | LOG_TARGET_ERRORLOG; ...@@ -99,8 +99,10 @@ $cfg->log_environ_targets = LOG_TARGET_SCREEN | LOG_TARGET_ERRORLOG;
//$cfg->log_environ_targets = LOG_TARGET_SCREEN | LOG_TARGET_ERRORLOG; //$cfg->log_environ_targets = LOG_TARGET_SCREEN | LOG_TARGET_ERRORLOG;
// If you use LOG_TARGET_FILE, this is the file that errors will be logged to. // If you use LOG_TARGET_FILE, this is the file that errors will be logged to.
// It's best to pick a path under dataroot, as we know we can write there. // By default, it will write to the file 'error.log' under dataroot. If you
$cfg->log_file = $CFG->dataroot . '/error.log'; // change this in config.php, make sure you use a folder which is writable by
// the webserver.
// $cfg->log_file = '/path/to/dataroot/error.log';
// The log levels that will generate backtraces. Useful for development, // The log levels that will generate backtraces. Useful for development,
// but probably only warnings are useful on a live site. // but probably only warnings are useful on a live site.
...@@ -131,8 +133,9 @@ $cfg->developermode = false; ...@@ -131,8 +133,9 @@ $cfg->developermode = false;
$cfg->sendemail = true; $cfg->sendemail = true;
// $cfg->sendallemailto = 'you@example.com'; // $cfg->sendallemailto = 'you@example.com';
// //
// Log basic details of emails sent out by Mahara. This will get big. // Log basic details of emails sent out by Mahara. Must be writable by the
// $cfg->emaillog = $cfg->dataroot . '/log/email.log'; // webserver user. This will get big.
// $cfg->emaillog = '/path/to/dataroot/email.log';
// capture performance information and print it // capture performance information and print it
// $cfg->perftofoot = true; // needs a call to mahara_performance_info (smarty callback) - see default theme's footer.tpl // $cfg->perftofoot = true; // needs a call to mahara_performance_info (smarty callback) - see default theme's footer.tpl
......
...@@ -255,7 +255,9 @@ function log_message ($message, $loglevel, $escape, $backtrace, $file=null, $lin ...@@ -255,7 +255,9 @@ function log_message ($message, $loglevel, $escape, $backtrace, $file=null, $lin
} }
if (function_exists('get_config')) { if (function_exists('get_config')) {
$logfilename = get_config('log_file'); if (!$logfilename = get_config('log_file')) {
$logfilename = get_config('dataroot') . 'error.log';
}
if (($targets & LOG_TARGET_FILE) && $logfilename) { if (($targets & LOG_TARGET_FILE) && $logfilename) {
global $LOGFILE_FH; global $LOGFILE_FH;
static $logfile_open_attempted = null; static $logfile_open_attempted = null;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment