Forums | Mahara Community
Support
/
redirect error logs from screen to error_log file
19 June 2011, 6:41
I've just completed installation and am getting various log messages to the screen. I would like to redirect them to the error_log file. The documentation tells me to read config-dist.php for examples on setting this up, but there's no relevant info there.Can someone please let me know where I can find the instructions for this (with sample code) or please drop it here.
thanks in advance.
19 June 2011, 19:44
Hi Neil,
If you put this in your config.php, then all of the log messages will be sent to the Apache error log:
$cfg->log_dbg_targets = LOG_TARGET_ERRORLOG;
$cfg->log_info_targets = LOG_TARGET_ERRORLOG;
$cfg->log_warn_targets = LOG_TARGET_ERRORLOG;
$cfg->log_environ_targets = LOG_TARGET_ERRORLOG;
Cheers,
Francois
20 June 2011, 7:11
Thanks Francois, i appreciate that very much.First, I got the error message
Parse error: syntax error, unexpected T_VARIABLE in [..]/mahara/config.php on line 85
which is the line i inserted the code. I notice all the other statements have the value in single quotes, so i tried that as well
$cfg->log_dbg_targets = 'LOG_TARGET_ERRORLOG';
still got the error message, on a whim i changed the text encoding from us-ascii to UTF8 on the cpanel (domain management web interface) text editor.
It worked.
then i went back and removed the single quotes, as per your syntax above - and it still works! So i presume the original error was from the editor having saved config.php in us-ascii rather than utf8.
thanks again.