Welcome Guest, Not a member yet? Register   Sign In
error_log function is not working in core/custom.php or core/exceptions.php in codeigniter
#1

[eluser]jayapalchandran[/eluser]
I used error_log function in core/common.php and Exceptions.php. it was not working.
Were as i have used in my controller and is working.

I log 404 using error_log in my controller.
I wanted to log notices and warnings using error_log.

i can see error message for error_log($elog, 1... in localhost which says sendmail cannot send to [email protected] ... which i assume the function is called but the error is not logged.


why is it not working in common.php were as it works in my controller?

the following is the code from common.php which is in system/core folder

Code:
if ( ! function_exists('_exception_handler'))
{
function _exception_handler($severity, $message, $filepath, $line)
{
  if ($severity == E_STRICT)
  {
   return;
  }

  $_error =& load_class('Exceptions', 'core');

  if (($severity & error_reporting()) == $severity)
  {
    @error_log($elog, 0);
    @error_log($elog, 3, docroot."/error_log.txt");  
    @error_log($elog, 1, '[email protected]');
    echo 'here'; // i am just testing

   $_error->show_php_error($severity, $message, $filepath, $line);
  }
  ... // few more lines follows


I don't want to use log_message or write_log here because i don't want CI to call those function multiple times even though i have set the threshold to zero. (ever time there is an error/exception/warning/notice there is a condition which checks threshold is 0 or not. and i totally removed the log.php from core. so i am not looking into it.




Theme © iAndrew 2016 - Forum software by © MyBB