1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Run something in XenForo_Error::logException

Discussion in 'XenForo Development Discussions' started by xf_phantom, Jun 24, 2013.

  1. xf_phantom

    xf_phantom Well-Known Member

    How could i run own code after the error has been logged into the db without editing/replacing the XenForo_Error file?

    PHP:
    $db->insert('xf_error_log', array(
                        
    'exception_date' => XenForo_Application::$time,
                        
    'user_id' => XenForo_Visitor::hasInstance() ? XenForo_Visitor::getUserId() : null,
                        
    'ip_address' => XenForo_Model::create('XenForo_Model_Login')->convertIpToLong(),
                        
    'exception_type' => get_class($e),
                        
    'message' => $e->getMessage(),
                        
    'filename' => $file,
                        
    'line' => $e->getLine(),
                        
    'trace_string' => $e->getTraceAsString(),
                        
    'request_state' => serialize($request)
                    ));
     

Share This Page