Since the following is related to my question and since i am using this i am suggesting this alternate way of logging error through PHP. The answer i had accepted is for setting error log using apache.
another way to log error using php is using the php function error_log
$elog = "\r\n[".date('d-m-Y H:i:s',time())."] - [".$_SERVER['REMOTE_ADDR']."] - $string - in file $file in line $line";
error_log($elog, 3, docroot."/error_log.txt");
error_log($elog, 1, 'firstname.lastname@example.org');
- First one will write the error to the current modules error_log in the server(PHP's system logger).
- Second will write to your custom file and the
- Third will send the error to the email address specified.
Check the parameters section which will explain the usage of the various arguments.